Create product

You can create products using the SDK. Here is an example of how to create a product:

import { Keyforge } from 'keyforge-js';
 
const keyforge = new Keyforge('sk_1234');
 
const product = await keyforge.products.create({
  name: 'My product',
  description: 'My product description',
  supportEmail: '[email protected]',
});

Parameters

PropTypeDefault
name
string
-
description
string | undefined
-
supportEmail
string | undefined
-
Support email

Even though the supportEmail parameter is optional, it is recommended to provide it. If none is provided, customers will be instructed to contact your account email for support.

Returns

Here is an example of the created product object:

{
  "id": "p_123456",
  "userId": "05d27bfb-61c7-45f7-9d07-09a41defc88a",
  "name": "My product",
  "description": "My product description",
  "supportEmail": "[email protected]",
  "portalShow": true,
  "portalAllowDeviceReset": true,
  "createdAt": "2024-05-19T04:31:03.000Z"
}

On this page