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

capacitor-persona

v0.0.2

Published

Native implementation for Persona ID verification service

Downloads

29

Readme

Persona Native Plugin

This Plugin is still under development. Feel free to contribute, ask questions and

This plugin is a simple bridge to the native implementations of Persona Identity Verification


Features / Roadmap

| Feat / Platform | Android | iOS | Web | | ---------------- | ------- | --- | --- | | Start Inquiry | 🚧 | ✅ | ❌ | | Modify the theme | 🚧 | 🚧 | ❌ |

✅ = Supported, 🚧 = Planned, ❌ = No support

Why is no Web implementation provided?

Personas embedded flow might be added at a later stage, but for now the focus is on the native SDK integration.

A feature is missing

Feel free to open an issue or implement it yourself & contribute.


Installation

Run npm install capacitor-persona to add the latest version to your npm project.

Please follow the additional steps for each platform

Android

The configuration follows the Persona Android SDK Integration Guide

  1. Add add(PersonaNative.class) to the init call in your apps MainActivity. This could look like the following:

    // Other imports...
    import com.example.myapp.EchoPlugin;
    
    public class MainActivity extends BridgeActivity {
    
      @Override
      public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    
        // Initializes the Bridge
        this.init(
            savedInstanceState,
            new ArrayList<Class<? extends Plugin>>() {
              {
                // Additional plugins you've installed go here
                // Ex: add(TotallyAwesomePlugin.class);
    
                // INSERT START
                add(PersonaNative.class);
                // INSERT END
              }
            }
          );
      }
    }
    
  2. (OPTIONAL: Replace strings) To replace strings with your own content, create a strings.xml file in your project dir. Add any strings you want to modify, following this example:

    <resources>
      <!-- some of your strings.xml strings -->
      <string name="persona_inquiry_start_title">This is the start screen title.</string>
      <string name="persona_inquiry_start_body">This is below that in the body.</string>
      <string name="persona_inquiry_start_button">I\'m a button!</string>
      <!-- more of your strings.xml strings -->
    </resources>

iOS

The configuration follows the Persona iOS SDK Integration Guide

  1. Permissions: Persona needs permissions to access the camera and photo

    • Navigate to your project's settings in Xcode and click the Info tab
    • Add a new "Privacy - Camera Usage Description" (NSCameraUsageDescription) entry (if not already present) to enable camera access.
    • Add a new "Privacy - Photo Library Usage Description" (NSPhotoLibraryUsageDescription) entry (if not already present) to enable photo library access.
  2. (OPTIONAL: Replace strings) Create a file called Persona.strings in your app bundle with the strings you want to replace:

    /*
      Persona.strings
    */
    
    "inquiryStartTitle" = "Verify your identity";
    "inquiryStartBody" = "Let’s make sure you’re you!";
    "inquiryStartButton" = "Get started";

Usage

Import the PersonaNative Plugin from Capacitor's Plugins:

import { Plugins } from '@capacitor/core';

const { PersonaNative } = Plugins;

If you want to have a typed version, you can use the following code instead:

  import { Plugins } from '@capacitor/core';
  import { PersonaNativePlugin } from 'capacitor-persona';

  const PersonaNative = Plugins.PersonaNative as PersonaNativePlugin;

startInquiry(config: InquiryConfig)

Starts an inquiry. You can pass the following arguments in the config:

| Parameter | Type | Description | | ----------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------ | | inquiryId | string | Starts an inquiry from an existing inquiryId | | templateId | string | Starts an inquiry with the specified template. Only used, if inquiryId is not specified. | | referenceId | string | Provides a referenceId that is added to the inquiry. E.g. a user identifier. Only used with templateId | | accountId | string | Links the inquiry to an existing account in Persona. Only used with templateId and if referenceId is not specified | | environment | 'sandbox' \| 'production' | Default: production, The environment to use. In sandbox, real verifications are not performed. |

Returns Promise<InquiryResult>

The InquiryResult contains data about the inquiry process. It can be one of InquirySuccessResult, InquiryCancelledResult, InquiryFailedResult or InquiryErrorResult. You can identify it by the type property, that is either success, cancelled, ...