End of Support for @suprsend/web-inbox. Migrate to
@suprsend/web-components
We have upgraded authentication of inbox from HMAC to JWT as it is more secure. Please migrate to newer SDK if you are on old one.
- Drop-in components: Pre-built UI with many customizable options which require minimal effort to build.
- Headless implementation: For more advanced use cases where you want to build UI/UX from scratch.
Integration
Integrate using script tag
This integration is used in Vanillajs, Django, Laravel, ruby etc where npm is not used.Integrate as npm package
This integration is used in framework based applications like angular, vuejs etc.suprsend-feed
, specify height for the container for infinite scroll to work properly.
Removing instance
Components will be removed automatically if you navigate away from the page (on unmounting). If you want to remove them manually, you can use below methods.Updating configuration dynamically
Accessing other instance methods
SDK internally callsnew SuprSend()
when you call initSuprSend()
then you can access instance using window.suprsend.client
. This instance has methods like preferences, webpush, event and user updates.
Config options
To customise SuprSend components you can pass config object.Parameter | Description |
---|---|
publicApiKey | Public API Key is mandatory field without which error will be thrown by SuprSendProvider. You can get this from SuprSend Dashboard. |
distinctId | Unique identifier to identify a user across platform. If a value is passed SDK will create user and authenticate user. If null value is passed authenticated user’s instance data will be cleared in your application, kind of logout. |
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 JWT token string is used as the new userToken. |
userAuthenticationHandler | This callback will be called after authenticating user internally when you pass distinctId field to give you back the response of user creation API call. |
host | Customise the host url. |
vapidKey | This key is needed only if you are implementing WebPush notifications. You can get it in SuprSend Dashboard —> Vendors —> WebPush |
swFileName | This key is needed only if you are implementing WebPush notifications and want to customise default serviceworker.js file name with your own service worker file name. |
shadowRoot | Shadow root reference to render components inside shadow dom |