Installation
We support 2 SDK’s for react based applications.-
@suprsend/react-core: This provides context providers and hooks to integrate SuprSend in to your application. If you want to use web-push, user methods, track events or implement your own UI for preferences and inbox by using provided methods, this library is better option. If you want to use any of inbuilt components for inbox or preferences then use
@suprsend/react. -
@suprsend/react: This library is built on top of
@suprsend/react-core, so all hooks, context providers and methods that are present in@suprsend/react-corelibrary are also present in this, with addition to that drop-in components like Inbox, NotificationsFeed, Preferences etc are available which comes with UI to ease integration.
Integration
SuprSendProvider
This context provider need to be wrapper around your component in which you want to use SuprSend methods. This is responsible for creating client instance(new SuprSend()), identify and reset user. You can access the SuprSend client instance using useSuprSendClient hook. This instance contains all methods needed to integrate preferences, webpush, track events and user methods.
After implementing the above SuprSendProvider you can be able to use all SuprSend features.