Socket
Book a DemoInstallSign in
Socket

@suprsend/react-preferences-headless

Package Overview
Dependencies
Maintainers
2
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@suprsend/react-preferences-headless

This SDK is used to integrate preferences functionality in React, React Native Applications

latest
npmnpm
Version
0.1.0
Version published
Weekly downloads
283
-41.16%
Maintainers
2
Weekly downloads
 
Created
Source

@suprsend/react-preferences-headless

This SDK is used to integrate preferences functionality in React, React Native Applications

Refer full documentation here

Example implementation is available here

Installation

npm install --save @suprsend/react-preferences-headless

Integration

import { SuprSendPreferenceProvider } from '@suprsend/react-preferences-headless';

function Example() {
  return (
    <SuprSendPreferenceProvider
      workspaceKey="<workspace_key>"
      distinctID="<distinct_id>"
      accessToken="<access_token>"
    >
      <Preference />
    </SuprSendPreferenceProvider>
  );
}

function Preference() {
  const preferenceData = usePreferences();
  const emitter = usePreferenceEvent();
  const {
    update_category_preference,
    update_channel_preference_in_category,
    update_overall_channel_preference,
  } = useUpdatePreferences();

  return <div>Design your component here using data from above hooks<div/>
}

License

MIT © https://github.com/suprsend

FAQs

Package last updated on 19 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts