How to Use the CometChat Authentication Token
We recommend using Authentication Tokens to log in your user. Please review the documentation for the language or framework you are using. If using the Custom Widget, refer to the documentation on How to log in users using an auth token.
-
If using the Auth Token to login the user to CometChat, you do not need to store or reference your Auth Key in the front-end. Specifically, do not include the auth key param when creating an UI Kit Settings object.
-
When a push token is registered, it is tied to the user’s authentication token. We recommend that each device has its own unique authentication token.
-
Our recommendation is that users have one authentication token per device. It is important to have one auth token per device, especially if you are using Push Notifications. If you reuse an auth token for different devices, notifications will only be sent to the last device where the token was registered.
-
If the device information is not present, you can generate a new auth token each time.
-
Our auth tokens do not expire, so there’s no need to delete them. However, you have the option to delete them if you prefer, as we provide APIs for managing auth tokens.