1.0.4 • Published 10 months ago

@effectiv-ai/device-react-native v1.0.4

Weekly downloads
-
License
SEE LICENSE IN LI...
Repository
github
Last release
10 months ago

@effectiv-ai/device-react-native

Effectiv Device SDK for React Native. Please visit our developer docs for detailed integration usage.

Installation

yarn add @effectiv-ai/device-react-native

Usage

Wrapping app with EffectivDeviceProvider

import React from 'react';
import { EffectivDeviceProvider } from '@effectiv-ai/device-react-native';

function App() {
  <EffectivDeviceProvider apiKey="<your-api-key>" env="SANDBOX">
    ...
  </EffectivDeviceProvider>;
}

Executing effectiv device SDK using the hook

import React from 'react';
import { useEffectivDevice } from '@effectiv-ai/device-react-native';

function Component() {
  const { execute } = useEffectivDevice();

  React.useEffect(() => {
    const customerSessionID = '<customer-session-id>';
    // or you can use `getSessionID` function provided by the useEffectivDevice hook for proxy session ID
    // you can also generate new session ID by using `generateSessionID` function
    execute({
      customer_session_id: customerSessionID,
      customer_user_id: '<customer-user-id>',
      event: '<event-name>',
      mode: 'LITE', // EXPERIMENTAL for beta features
    }).then((response) => {
      console.log('***EffectivDevice Response***:/n', response);
    });
  }, [execute]);
}

License

Paid License


1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago

0.1.7

12 months ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago