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-ts-accountprotection

v0.1.2

Published

Wrapper for the Transmit Security Account Protection SDK

Downloads

14

Readme

React Native - Transmit Security Account Protection SDK

Detect risk in customer interactions on digital channels, and enable informed identity and trust decisions across the consumer experience.

About Account Protection SDK

The React Native Detection and Response SDK Wrapper is a versatile tool designed to seamlessly integrate the powerful capabilities of the Detection and Response services into your React Native applications. By encapsulating the APIs of the native SDKs for both iOS and Android platforms, this wrapper empowers enterprises to confidently enhance security measures while maintaining a smooth user experience.

Using this module, you can easily integrate our Account Protection SDK into your React Native app. Learn more on our website.

Understand the flows

We recommended that you read more about the native Account Protection SDKs as described in our iOS documentation and Android documentation

Configure your app

To integrate this module, you'll need to configure an application in our portal.

Example project setup

  1. In your project, navigate to example/src/config.ts and configure the clientId and secret using the configuration obtained from the Transmit portal.
  2. Ensure you have all the necessary dependencies by running yarn in both the module's root folder and the example root folder.
  3. Run the example app on a real device using Xcode or Android Studio. Alternatively, execute yarn example ios or yarn example android.

Important Security Note: Never store your secret in a front-end application.

The example app utilizes a mock server to manage communication with the authentication platform. This mock server employs the secret you have specified in example/src/config.ts exclusively for demonstration purposes. It is paramount that you safeguard your secret in a secure and confidential location.

Installation

npm install react-native-ts-accountprotection

iOS Setup

You might need to execute pod install in your project's /ios folder.

Android Setup

Add to app/build.gradle under repositories

repositories {
  google()
  maven {
    url('https://transmit.jfrog.io/artifactory/transmit-security-gradle-release-local/')
  }
}

dependencies {
  implementation("com.ts.sdk:accountprotection:2.1.+")
}

Module Setup

Initialize the Android SDK

First, update your strings.xml by adding

<resources>
    <!-- Transmit Security Credentials -->
    <string name="transmit_security_client_id">"CLIENT_ID"</string>
    <string name="transmit_security_base_url">https://api.transmitsecurity.io/</string>
</resources>

Next open your MainApplication.kt file in your React Native android project, and add:

override fun onCreate() {
  super.onCreate()
  TSAccountProtection.initializeSDK(this.applicationContext) // initialize the SDK
    ...
}

Initialize the iOS SDK

First, Create a filed named TransmitSecurity.plist in your native iOS Xcode project:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>credentials</key>
	<dict>
		<key>baseUrl</key>
		<string>https://api.transmitsecurity.io/</string>
		<key>clientId</key>
		<string>[CLIENT_ID]</string>
	</dict>
</dict>
</plist>

Next initialize the SDK whe your app component is ready

import TSAccountProtectionSDKModule, { TSAccountProtectionSDK } from 'react-native-ts-accountprotection';

componentDidMount(): void {
    // Setup the module as soon your component is ready
    await TSAccountProtectionSDKModule.initializeSDK();
}

Module API

Set UserID after authentication

await TSAccountProtectionSDKModule.setUserId(username);

Trigger Action

private handleTriggerActionLoginExample = async () => {
  const triggerActionResponse = await TSAccountProtectionSDKModule.triggerAction(
    TSAccountProtectionSDK.TSAction.login,
    { 
      correlationId: "CORRELATION_ID", 
      claimUserId: "CLAIM_USER_ID", 
      referenceUserId: "REFERENCE_USER_ID", 
      transactionData: undefined
    }
  )
  const actionToken = triggerActionResponse.actionToken;
  console.log("Action Token: ", actionToken); // Use the action token to invoke the recommendation API.
}

Clear User ID

await TSAccountProtectionSDKModule.clearUser();

Important

Please take note that the example application uses a client-side mock server. In a production environment, a real server is required. Additionally, it is crucial to emphasize that storing the client secret in your front-end application is strictly discouraged for security reasons.

Support

Email us for support

Author

Transmit Security, https://github.com/TransmitSecurity

License

This project is licensed under the MIT license. See the LICENSE file for more info.