npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@seontechnologies/seon-react-native-mobile-wrapper

v3.0.0

Published

SEON Mobile SDK React Native Wrapper

Downloads

2,139

Readme

SEON Mobile SDK React Native Wrapper

This package provides a React Native wrapper for the SEON Mobile SDK, allowing you to integrate SEON's Device Intelligence module into your React Native projects. It supports both Android and iOS platforms.

Installation

Install the package in your existing React Native project:

npm install @seontechnologies/seon-react-native-mobile-wrapper

Usage

Import the SEON wrapper in your JavaScript files:

import { SeonReactNativeMobileWrapper as Seon } from '@seontechnologies/seon-react-native-mobile-wrapper';

Basic Usage

Here's a basic example of how to use the SEON wrapper:

// Replace 'YOUR_UNIQUE_SESSION_ID' with your actual session identifier.
await Seon.setSessionId('YOUR_UNIQUE_SESSION_ID');

// Enable logging (optional)
await Seon.setLoggingEnabled(true);

// Generate fingerprint
try {
    const fingerprint = await Seon.getFingerprintBase64();
    // Send 'fingeprint' to your backend and use it as the session property
    // for your Fraud API request.
} catch (error) {
    // Handle errors
}

Behaviour Monitoring

The SEON SDK can monitor user behaviour to collect behaviour-based signals. It's recommended to run the monitoring for at least a few seconds to gather sufficient data.

Starting Behaviour Monitoring

await Seon.startBehaviourMonitoring();
// Stopping Behaviour Monitoring
try {
    const behaviourData = await Seon.stopBehaviourMonitoring();
    // Send 'behaviourData' to your backend and use it as the session property
    // for your Fraud API request.
} catch (error) {
    // Handle errors
}

Geolocation Configuration

The SEON SDK supports geolocation services. You can configure these services using the SeonGeolocationConfig interface:

Permissions

Ensure that your application has the necessary permissions to access location services. Update your app's configuration files and request permissions at runtime.

iOS

Add the following keys to your Info.plist file with appropriate usage descriptions:

  • NSLocationWhenInUseUsageDescription
  • NSLocationAlwaysAndWhenInUseUsageDescription (if needed)

Android

Add the following permissions to your AndroidManifest.xml:

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

Note: Remember to request permissions at runtime.

Enabling Geolocation Services

await Seon.setGeolocationEnabled(true);

OR

const geolocationConfig = {
    prefetchEnabled: true, // Android only
    geolocationServiceTimeoutMs: 5000, // in milliseconds
    maxGeoLocationCacheAgeSec: 300, // Android only
    geolocationEnabled: true,
};

await Seon.setGeoLocationConfig(geolocationConfig);
  • prefetchEnabled: When enabled, SEON pre-fetches location on creation of a SeonReactNativeMobileWrapper object for better performance. (Android only)
  • geolocationServiceTimeoutMs: Network timeout for SEON's geolocation services in milliseconds. Default is 3000. (Android and iOS)
  • maxGeoLocationCacheAgeSec: Maximum location data age permitted in seconds. Default is 600. (Android only)
  • geolocationEnabled: Enables or disables SEON's geolocation services. (Android and iOS)

Platform Specific Notes

  • The prefetchEnabled and maxGeoLocationCacheAgeSec properties in the geolocation configuration are only applicable on Android.
  • Make sure you have the necessary permissions set up in your Android and iOS projects for geolocation services if you plan to use them.

Error Handling

All methods return promises, so you can use try-catch blocks or .catch() to handle any errors that might occur during the SDK operations.

Additional Information

For more detailed information about the iOS and Android SDKs, please refer to their respective GitHub repositories:

Support

If you encounter any issues or have questions about the SEON Mobile SDK React Native Wrapper, please contact SEON support or refer to the official documentation.