Command Line Interface CLI

Command Line Interface CLI #


cli


“Most companies developing mobile on the current native stacks must compromise in some way. Either on productivity (develop the same product multiple times with different engineers on different stacks), on quality (make low-quality apps) or on a scope (focus on a single platform). The path towards stopping these compromises is inventing new mobile stacks, like React Native.” — Tal Kol, ex-Head of Mobile Engineering at Wix.com

AppKey-WebAuthn #

The AppKey-WebAuthn Node module provides functional bindings between a Node.js/React application and the AppKey service. To integrate this module into your Node.js/React application, follow these steps:

  1. Open terminal and go to root project folder where package.json is

  2. npm i appkey-webauthn

This package can be found at the following github link

    https://github.com/Cosync/AppKey-WebAuthn.git

This open-source package, released under the Apache license, provides JavaScript React bindings for the Cosync AppKey REST API. It simplifies the integration of React and React Native applications with the AppKey service.

The AppKey-WebAuthn npm package enables the React Native Command Line Interface AppKey demo to communicate with the AppKey service.

AppKey-ReactNativeDemo #

Cosync provides a React Native sample application to demonstrate the React Native bindings for the Cosync AppKey passkey service. The demo is open source, released under the Apache license, and available on GitHub. Download it, run it on a mobile device, and see it in action.

    https://github.com/Cosync/AppKey-ReactNativeDemo.git

You can clone this directory onto your computer using the following git clone command

    git clone git@github.com:Cosync/AppKey-ReactNativeDemo.git

Edit the config/Config.js file and update it with your APP_TOKEN and GOOGLE_CLIENT_ID as described in the AppKey Portal section of this documentation.

export const Config = { 
    REST_API : 'https://api.appkey.io',
    GOOGLE_CLIENT_ID: 'iOS Google Client ID',
    APP_TOKEN : 'Your App Token'
}

After you have edited the Config.js file, you must install the node dependencies:

    npm install

Once that is complete, on iOS you will need to install the relevant Cocoa Pods as follows:

    cd ios
    pod install
    cd ..

To run the React-Native demo on iOS you will need to execute one of the following two commands:

    # using npm
    npm run ios

    # OR using Yarn
    yarn ios

Before running that command, ensure that an iOS simulator is up and running so the npm run ios command can detect it. Additionally, verify that the “Enrolled in Face ID” option is enabled in the simulator settings.


enroll


This feature allows you to simulate facial biometric verification in the iOS simulator, enabling access to the keychain where iOS passkeys are stored. The “Matching Face” command simulates a matching face.

Once you have complete the npm run ios command, you should see the following program within your iOS simulator.


reactnativedemo


After logging in with a registered email and passkey, you should see this screen:


loggedin