Authenticate Users
Creating an authentication token for your user
Last updated
Creating an authentication token for your user
Last updated
To allow your users to authenticate with our web app through the THNDR SDK, you need to generate an authentication token. This token should be created when the user initiates an action to open the THNDR iframe (e.g., a button click).
Server-Side Service: The authentication token must be generated server-side to securely handle the API key that we provide. Do not expose the API key on the client-side to avoid security risks.
Calling the Authentication Endpoint: Your server should make a POST
request to the following endpoint, including the user's metadata:
Request Body:
userId
: The unique ID of your user.
displayName
: The display name of the user.
Request Header:
Response: Upon successful authentication, the endpoint will return a token in the response:
Response Example:
Using the Token in the getToken
Callback: Once you receive the token in the server response, return this token in the getToken
callback of the THNDR SDK. Here's an example: