Skip to content

Generate Customer Token

To fetch a customer token for a logged-in customer, make a POST call to https://api.gamifiera.com/v1/auth/customer-token/<customerId> with the header X-API-Key: <yourApiKey>.

You will receive a JSON object with a token:

json
{
  "token": "<customerToken>"
}

This token should be included in the init call when the customer is logged in. It is valid in 120 hours and may be stored as a cookie to avoid new calls for each page view. In that case the cookie should be cleared when customer is logged out. If you are running a single page application, see the following page.

⚠️ Warning:
API key will give you full access to the API, so be sure to keep it secure! Do not share your API Key in publicly accessiable places such as your git repo, client-side code etc.