The SDK uses customer tokens to securely recognize and identify the currently logged-in customer during initialization. In practice, a customer token is a JSON Web Token (JWT) that has been generated securely on your platform’s backend and is signed using the HS256 algorithm with one of your account’s signing keys.Documentation Index
Fetch the complete documentation index at: https://dev.smile.io/llms.txt
Use this file to discover all available pages before exploring further.
JWT headers
When generating a customer token, the values in the JWT header are constant and never change:JSON
JWT payload
When generating a customer token, the payload of the JWT should be dynamic, e.g.JSON
dest— The intended recipient of the JWT (should always beapi.smile.io).sub— An identifier for the currently logged-in customer (see notes below).exp— When the JWT expires (recommendation: 5 minutes after JWT is generated).
Customer identifiers (sub values)
You can identify the logged-in customer by providing a sub claim in the payload of the JWT in one of the following supported formats. Choose the appropriate format based on which unique identifier you have available for the currently logged-in customer.
| Type of ID | Format | Example value |
|---|---|---|
| Smile Customer ID | SmileCustomer:{id} | SmileCustomer:304169228 |
| Shopify Customer ID | ShopifyCustomer:{id} | ShopifyCustomer:10733458 |
| BigCommerce Customer ID | BigCommerceCustomer:{id} | BigCommerceCustomer:7398675 |
| Custom Platform Customer ID | CustomPlatformCustomer:{id} | CustomPlatformCustomer:937485 |