Step-by-step guide to migrate from @suprsend/react-inbox
to @suprsend/react
.
@suprsend/react-inbox
only contains inbox related code.SuprSendInbox
component and SuprSendProvider
component(headless) used to take care of authentication if you pass distinctId
, workspaceKey
and subscriberId
. But in new SDK you can use SuprSendProvider to authenticate user and all other features like inbox, preferences, webpush etc can be accessed inside that context provide.
SuprSendInbox
used to have inbuilt toast notification feature using react-toastify library. But the latest versions of this library created few peerDependencies which created issues for us. So we have exposed event listener to listen to new notification arrival and in that callback you will get new notification payload which you can use to show toast notification using any of your toast library. Refer implementation guide here.
SuprSendInbox
component (Drop-in)Remove existing `@suprsend/react-inbox` and install `@suprsend/react`
Change User Authentication
Import New `Inbox` component
Inbox
component and use it instead of SuprSendInbox
. Remove distinctId
, workspaceKey
and subscriberId
props since authentication is handled by SuprSendProvider in above step. Please remove any invalid prop present in existing component. Check all available props in new component.Change Toast Implementation