Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-persona

Package Overview
Dependencies
Maintainers
0
Versions
140
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-persona

Launch a mobile native implementation of the Persona inquiry flow from React Native.

  • 2.9.4
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
13K
increased by10.01%
Maintainers
0
Weekly downloads
 
Created
Source

Persona Android SDKs and Demo

Development

First, run yarn in the project root.

yarn

To test changes to SDK, we will use the Example App in example app.

Start Metro bundler.

This will bundle JavaScript and serve it to your React Native sample app. Keep the Metro bundler running in a terminal.

yarn example start

Metro bundler compiles source code and caches compiled targets to speed up incremental rebuilds. However, it's possible that this can lead to random failures if things get out of sync. If you ever run into any weird issues, it's worth running yarn example start --reset-cache again.

Start example app in iOS simulator

Use the built-in CLI command with Metro running.

yarn example ios

Or open ios/example.xcworkspace in XCode and build + run.

Start example app in Android simulator

Use the built-in CLI command with Metro running.

yarn example android

Or open the Android project in Android Studio and build + run.

Adding Dependencies

If you need to add any open source dependencies to this project, you'll need to make sure that the license for that project is acceptable. At the time of writing, licenses that are not GPL, LGPL, or AGPL are likely to be acceptable. Please consult with #legal for specific questions though.

We use the license_finder gem to ensure that we're only using open source projects with licenses that we explicitly allow. If and when you need to add a new license to our allow-list, you can edit the file at doc/dependency_decisions.yml accordingly. If you check out license_finder's documentation, you'll see how to use the tool to make these updates to the yml file.

Installing in your own project


yarn add react-native-persona

Usage

import {Environment, Inquiry} from "react-native-persona";

// Start an inquiry.
Inquiry.fromTemplate('itmpl_Ygs16MKTkA6obnF8C3Rb17dm')
  .environment(Environment.SANDBOX)
  .onComplete((inquiryId, status, fields) =>
    Alert.alert('Complete', `Inquiry ${inquiryId} completed with status "${status}."`,),
  )
  .onCanceled((inquiryId, sessionToken) =>
    Alert.alert('Canceled', `Inquiry ${inquiryId} was cancelled`),
  )
  .onError(error => Alert.alert('Error', error.message))
  .build()
  .start();

Theming

Set your own colors, buttons, fonts, and more. This can be done via the Persona Dashboard. For more information on using the theme editor, see our help article.

Updating SDK Versions

Android

Update the sdk version in android/build.gradle

implementation 'com.withpersona.sdk2:inquiry:X.Y.Z'

iOS

Update the sdk version in RNPersonaInquiry2.podspec

s.dependency 'PersonaInquirySDK2', '~> X.Y.Z'

Go to example/ios directory, update the Podfiles by running

pod update PersonaInquirySDK2 --repo-update
pod install --repo-update

React Native

Bump react native version in package.json if needed.

Commit and push changed files including:

  • android/build.gradle
  • RNPersonaInquiry2.podspec
  • package.json
  • example/ios/Podfile.lock

Keywords

FAQs

Package last updated on 19 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc