POST
/
customer
/
{customer_id}
/
token
JavaScript
import Openint from '@openint/sdk';

const client = new Openint({
  token: 'My Token',
});

const response = await client.createToken('x');

console.log(response.token);
{
  "token": "<string>",
  "magic_link_url": "<string>",
  "api_key": "<string>"
}

Authorizations

Authorization
string
header
required

Organization API Key available in the settings page of the OpenInt Console or Customer API Key or Token Customer authentication token created using the create customer token API. It is passed in the authorization header with format: Bearer {token}

Path Parameters

customer_id
string
required

The unique ID of the customer to create the token for

Minimum length: 1

Body

application/json
validity_in_seconds
number
default:2592000

How long the publishable token and magic link url will be valid for (in seconds) before it expires. By default it will be valid for 30 days unless otherwise specified.

connect_options
object

Response

Successful response

token
string
required

A short-lived publishable authentication token to use for customer api requests from the frontend. This token by default expires in 30 days unless otherwise specified via the validity_in_seconds parameter.

A link that can be shared with customers to use @Connect in any browser. This link will expire in 30 days by default unless otherwise specified via the validity_in_seconds parameter.

api_key
string | null
required

A long-lived customer API key to use for API requests. Not meant to be published to the frontend.