Web SDK Integration to enable WebPush, Preferences, & In-app feed in javascript websites like React, Vue, and Next.js.
Create Client
Params | Description |
---|---|
publicApiKey* | This is public Key used to authenticate API calls to SuprSend. Get it in SuprSend dashboard ApiKeys -> Public Keys section |
Authenticate User
Properties | Description |
---|---|
distinctId* | Unique identifier to identify a user across platform. |
userToken | Mandatory when enhanced security mode is on. This is ES256 JWT token generated in your server-side. Refer docs to create userToken. |
refreshUserToken | This function is called by SDK internally to get new userToken before existing token is expired. The returned string is used as the new userToken. |
Promise<ApiResponse>
distinctId
is attached to SuprSend instance. To check for userToken also pass checkUserToken flag true.Reset user
Promise<ApiResponse>
Promise<ApiResponse>