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-persona

v2.6.15

Published

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

Downloads

88,638

Readme

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.

Theming the example app

Run the persona-tool to customize the theme.

$ cd example
$ yarn persona-tool

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.

Note that the following instructions are for deprecated client side theming only.

To test legacy client side themes, use the example app:

cd example

Link the persona-tool using the following command (only necessary during development, linked automatically when the package is installed using yarn add or npm install).

yarn dev-only:link-bin

To unlink:

yarn dev-only:unlink-bin

Run through the tool using yarn persona-tool and following the instructions to add the required snippet to your package.json.

Update theme colors accordingly:

  • Example: Update persona.androidTheme.backgroundColor to #FFFFFF

Run yarn persona-tool again.

Launch the example app and launch a flow.

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