Device fingerprinting library using react native
npm install @ginger-ai/ginger-react-nativeDevice fingerprinting library using react native
Using npm:
``sh`
npm install @ginger-ai/ginger-react-native
Using yarn:
`sh`
yarn add @ginger-ai/ginger-react-native
Using pnpm:
`sh`
pnpm add @ginger-ai/ginger-react-native
To get started, you need to be part of an organization, see the Joining an organization quick Start Guide.
Join your organization and get a PUBLIC_APIKEY.
- Set apikey to your GINGER-AI Public API Key.
`jsx
import { GingerRNProvider } from '@ginger-ai/ginger-react-native';
function App() {
return (
apikey: PUBLIC_API_KEY,
}}
>
);
}
`
> The initialization function is the entrypoint into the SDK. You must initialize it at a root component so that you can use other hooks
`tsx
import { useGinger } from '@ginger-ai/ginger-react-native';
function YourApp() {
const { initialize, data, error, loading } = useGinger();
useEffect(() => {
const initializeGingerClient = async () => {
try {
await initialize();
} catch (e) {
console.error(e);
}
};
initializeGingerClient();
});
}
`
After a successful initialization process, you can track event in any child component
`tsx`
const { register, submitEvent, tracker } = useEvent({
event_type: 'login',
request_id: '',
track_fields: [
{ id: 'password', ltm: true },
{ id: 'email', ltm: true },
],
});
Register the tracked fields in the component
`tsx
// Basic registration
// With an additional custom handler
onChangeText: (text: any) => handleInputChange(text, 'email'),
})}
value={formFields.email}
/>
`
Use tracker to see the current values being trackedsubmitEvent` to submit the tracked data
Use
See the contributing guide to learn how to contribute to the repository and the development workflow.