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

react-native-device-risk

v4.1.2

Published

React bridge to enable iOS and Android Device Risk SDKs to be used by React Native apps

Downloads

6,892

Readme

Socure Device Risk SDK React Native Bridge

The Socure Device Risk SDK React Native bridge provides Reach developers with the ability to call the Socure Device Risk SDK, either the Android or iOS native library variants, through React.

This guide covers the integration within React, as well as React Native implementation on iOS and Android.

Minimum Requirements iOS 13 and above Android SDK version 34 and above

Introduction

Please read the documentation on either the Android or iOS native library variants to understand how the Device Risk SDK works.

Installation

Please follow the instructions below to add this wrapper library to your project. Alternatively, you can use this sample app as a starting point.

Add the following dependency to package.json:

npm install --save react-native-device-risk

Android

Step 1: Open the module level build.gradle for the main project module and inside of the defaultConfig section, set the minSdkVersion to 34

Step 2: Synchronize your gradle projects The Android side of the Bridge should be ready to run.

Note: If pulling from Maven, implement the below)

buildscript {
	…………..
	dependencies {
		……………………
		classpath ‘com.github.dcendents:android-maven-gradle-plugin:1.5’
	}
}

(NOT IN THE buildscript code block above. allprojects is a sibling to build script)

You will receive a username and token from Socure
Place these variables in you gradle.properties file inside your Android project

allprojects {
    repositories {
        …….

        maven {
            url “https://jitpack.io”
        }
    }
}
  • Ensure Kotlin plugin is added in the dependencies section:
buildscript {

                .....

               dependencies {

                  .....

                  classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:x.x.x"

               }

           }

Note: Socure has tested the build with plugin version 1.8.10.

Step 3:

In the main module (<root project dir>/android/app/build.gradle) add the below dependency in dependencies {} section:

dependencies {
   .....
   implementation "org.jetbrains.kotlin:kotlin-stdlib:x.x.x"
   .....
}

Note: Socure has tested the build with plugin version 1.8.10.

Build and run:

  • Run yarn install.
  • Run react-native run-android from the root folder.

iOS

Step 1: Install Socure SDK React Native Bridge using CocoaPods (recommended)

Inside your target, add the corresponding pod lines

use_frameworks!

  pod 'SocureDeviceRisk'

Update your pods from the terminal

pod install

You can also copy the folder react-native-device-risk and add it along with your other React Native pods.

Step 2: Add appropriate permissions for the services you want DeviceRisk SDK to use

This is explained in more detail in the native iOS library’s documentation

Step 3:

  • Run react-native run-ios.

Configuration and usage

For instructions on how to configure the SDK, see the React Native documentation on DevHub.

Example

You can checkout the example app from here. The file App.js shows the JS function calls used and how to ultimately retrieve the Device Risk Session ID.