Integration

Integrate Passkey Ready into your client application to learn how many of your users are ready to adopt passkeys.

Import

Web

NPM

Install the Authentikit npm package:

npm i --save @passageidentity/authentikit

CDN

The CDN version of Authentikit is available at https://cdn.passage.id/authentikit.js.

iOS

You can import Authentikit via the Swift Package Manager. Simply search SPM for this url:

https://github.com/passageidentity/passage-authentikit-ios

Or you can import it using CocoaPods by add this pod to your app's Podfile: pod 'PassageAuthentikit'

Android

In your app-level build.gradle file, add the Authentikit dependency:

dependencies {
    implementation 'id.passage.android:authentikit:0.1.0'
}

Implementation

1. Get Client Side Key

Passkey Ready requires the client side key for your Passage organization where you want results to be posted. This can be found on the organization settings page of Passage Console.

2. Integrate into your app

Web

NPM

For single-page apps built with tools like React, Vue, or Angular we recommend placing this code near the main app constructor or function to ensure that it executes on all pages.

  1. Import the Authentikit class and construct an Authentikit object using the client side key.

  2. Make a call to authentikit.passkey.evaluateReadiness() on the page load of your main app body.

import { useEffect } from 'react';
import { Authentikit } from '@passageidentity/authentikit';

function App() {
    useEffect(() => {
        const authentikit = new Authentikit({clientSideKey: 'YOUR_CLIENT_SIDE_KEY'});
         authentikit.passkey.evaluateReadiness();
    },[]);

    return (
        // Main app body
    );
}

export default App;

CDN

For apps built using the CDN Authentitkit script we recommend placing the code in a <script> tag inside the <head> tags on your app.

<head>
    <script type="module">
        import { Authentikit } from 'https://cdn.passage.id/authentikit.js'
        const authentikit = new Authentikit({clientSideKey: clientSideKey});
        authentikit.passkey.evaluateReadiness();
    </script>
</head>

iOS

import Authentikit
 
let authentikit = Authentikit(clientSideKey: "YOUR_CLIENT_SIDE_KEY")
try await authentikit.passkey.evaluateReadiness()

Android

import id.passage.authentikit.Authentikit
 
val authentikit = Authentikit(context, "YOUR_CLIENT_SIDE_KEY")
 
try {
    authkit.passkey.evaluateReadiness()
} catch (e: PasskeyEvaluationException) {
    // Handle error
}

Cross-Platform

If you are developing a cross-platform app using a framework like React Native or Flutter we recommend using the native iOS, Android, or Web SDKs within your cross-platform app directly.

When integrating Passkey Ready into your app, consider the environments you may be posting data from. For example, if you integrate Passkey Ready into a development or staging environment, you may end up recording results that aren't representative of your production environment.

Testing

After integrating Passkey Ready into your client application you can test the integration by visiting your app in a browser or on your mobile device. The results will be posted to your Passage organization on the Passkey Ready page in Passage Console.

Last updated

Change request #404: changes for Android docs - Hosted Auth