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

@keyri/cordova-keyri

v0.4.0

Published

Cordova Keyri SDK Plugin for QR login

Downloads

37

Readme

System Requirements

  • iOS 14+, Swift 5.3
  • Android API level 23 or higher, target sdk 33 or higher AndroidX, Kotlin coroutines compatability

Interacting with the Plugin

Please see the examples below as well as a full set of method examples here: https://github.com/Keyri-Co/sample-cordova-app/blob/main/keyriSample/www/js/index.js

Initialize Keyri

To initialize the Keyri object, simply call the initialize method, and pass in your app key and api key, generated in the Keyri dashboard

Keyri.initialize({
    appKey: appKey,
    publicApiKey: publicApiKey,
    serviceEncryptionKey: serviceEncryptionKey,
    blockEmulatorDetection: true
})
    .then((message) => {
        console.log('CordovaKeyri.initialize', message);
        isInitialized();
    })
    .catch((e) => {
        console.log('CordovaKeyri.initialize', e);
    });

Generate and retrieve association key

The association key is the cryptographic identity we use to identify users. It sits in the Trusted Development Environment, a hardware separated chip shielded from attacks to the main perating system. The key functions as a P256 Curve signing key. To generate:

Keyri.generateAssociationKey('[email protected]')
    .then((key) => {
        console.log('CordovaKeyri.generateAssociationKey', key);
        alert('Key generated: ' + key)
    })
    .catch((e) => {
        console.log('CordovaKeyri.generateAssociationKey', e);
    });

To look up an existing user's key:

Keyri.getAssociationKey('[email protected]')
    .then((key) => {
        console.log('CordovaKeyri.getAssociationKey', key);
        alert('Association key: ' + key);
    })
    .catch((e) => {
        console.log('CordovaKeyri.getAssociationKey', e);
    });

Keyri QR Auth

QR Auth can be processed by Keyri with a single function call. This process handles scanning the code, generating the session info, displaying a confirmation screen to the user, and, if the user confirms, sending the encrypted payload you provide to the Keyri widget in your browser.

Keyri.easyKeyriAuth('Payload', '[email protected]')
    .then(() => {
        console.log('CordovaKeyri.easyKeyriAuth', 'ok');
        alert('Authorized');
    })
    .catch((e) => {
        console.log('CordovaKeyri.easyKeyriAuth', e);
    });

User Signatures

The association keys can be used to sign data to send to a remote server. If the server has the user's public key (see above), it can then verify the identity of the user as a security measure. Below is an example of how to create a signature of some data, passed in as a string

Keyri.generateUserSignature('[email protected]', 'Custom data')
    .then((signature) => {
        console.log('CordovaKeyri.generateUserSignature', signature);
        alert('Signature generated: ' + signature)
    })
    .catch((e) => {
        console.log('CordovaKeyri.generateUserSignature', e);
    });

Fingerprint Events

You can send an event containing a device snapshot to our dashboard. The response you receive will be sent, as is, to your own backend, where you can utilize our scripts to help you decrypt. See the code sample below and https://docs.keyri.com/fraud-prevention for more

Keyri.sendEvent({publicUserId: '[email protected]', eventType: 'visits', success: true})
    .then(() => {
        console.log('CordovaKeyri.sendEvent', 'ok');
        alert('Event sent!');
    })
    .catch((e) => {
        console.log('CordovaKeyri.sendEvent', e);
    });

License

This library is available under paid and free licenses.

Details

What's allowed under the license:

  • Free use for any app under the Keyri Developer plan.
  • Any modifications as needed to work in your app

What's not allowed under the license:

  • Redistribution under a different license
  • Removing attribution
  • Modifying logos
  • Indemnification: using this free software is ‘at your own risk’, so you can’t sue Keyri, Inc. for problems caused by this library

Disclaimer

We care deeply about the quality of our product and rigorously test every piece of functionality we offer. That said, every integration is different. Every app on the App Store has a different permutation of build settings, compiler flags, processor requirements, compatability issues etc and it's impossible for us to cover all of those bases, so we strongly recommend thorough testing of your integration before shipping to production. Please feel free to file a bug or issue if you notice anything that seems wrong or weird on GitHub 🙂