@ideem/zsm-react-native
v2.5.0
Published
ZSM makes 2FA easy and invisible for everyone, all the time, using advanced cryptography like MPC to establish cryptographic proof of the origin of any transaction or login attempt, while eliminating opportunities for social engineering. ZSM has no relian
Readme
ZSM Client SDK for React Native
Contents
This SDK contains the resources needed to learn about Ideem's FIDO2 Authenticator and Universal MFA capabilities, and integrate them into your own React native applications. These resources include documentation and example applications.
NOTE: Prior to integrating the SDK into your own applications, please reach out to Ideem support, [email protected], to obtain configuration
Getting Started
Prerequisites
- React Native Version:
>=0.60 - Node.js Version:
>=12.0.0 - An Application ID from Ideem. Reach out to [email protected] to obtain one.
Installation
1. Install the Package
npm install @ideem/zsm-react-nativeOr with Yarn:
yarn add @ideem/zsm-react-native2. Link Native Modules
This library uses React Native's auto-linking. However, if manual linking is necessary:
iOS: Add the following to your
Podfile:pod 'zsm-react-native', :path => '../node_modules/@ideem/zsm-react-native'Then run:
cd ios && pod installAndroid: No additional setup is required unless auto-linking is disabled.
3. Verify Installation
Check the library is correctly installed and linked:
react-native doctorUsage
Basic Integration Example
Here’s how to initialize and use the SDK:
import { UMFAClient } from '@ideem/zsm-react-native';
const config = {
application_id: 'YOUR_APPLICATION_ID',
host_url: 'https://zsm-authenticator-demo.useideem.com/',
application_environment: 'TEST',
api_key: 'YOUR_API_KEY'
};
const client = new UMFAClient(config);
async function login(username) {
try {
const isEnrolled = await client.checkEnrollment(username);
const token = isEnrolled
? await client.authenticate(username)
: await client.enroll(username);
console.log('Authentication Token:', token);
} catch (error) {
console.error('Error during authentication:', error.message);
}
}Example Application
You can find example applications in the examples/ directory. These include:
- Basic Authentication: Demonstrates login and enrollment.
- Payment Flow: Simulates payment using authentication.
To run an example, e.g. for the umfa example:
- Navigate to the example directory:
cd examples/umfa - Install dependencies:
npm install - Start the development server:
npm start
Troubleshooting
React Native Environment Issues: Ensure your environment is correctly configured for React Native. Refer to the React Native Environment Setup.
Native Dependency Issues:
- Run
pod installfor iOS. - Verify your
android/app/build.gradlefor proper linking.
- Run
Documentation
Documentation can be viewed online at:
- UMFA: https://docs.useideem.com/umfa_sdk/index.html.
- FIDO2: https://docs.useideem.com/fido2_sdk/index.html.
Support
Support can be received by emailing [email protected] or accessing our Customer Support site at https://support.useideem.com
Legal
Copyright (C) Ideem, Inc. - All Rights Reserved
This source code and other resources included in this SDK are protected under international copyright law. All rights reserved and protected by the copyright holders.
The files included in this distribution are confidential and only available to authorized individuals with the permission of the copyright holders. If you encounter this file and do not have permission, please contact the copyright holders and delete this file.
This library is proprietary and licensed under Ideem's terms of use. Unauthorized use or distribution is prohibited.
