Socket
Socket
Sign inDemoInstall

@nuts-foundation/irma-core

Package Overview
Dependencies
0
Maintainers
2
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @nuts-foundation/irma-core

The state machine for implementing IRMA flows, that plugins can register on


Version published
Weekly downloads
0
decreased by-100%
Maintainers
2
Install size
8.00 kB
Created
Weekly downloads
 

Readme

Source

IRMA core

This package contains the state machine for implementing IRMA flows. You can register plugins with this state machine and then start the machine:

const IrmaCore = require('irma-core');
const irma     = new IrmaCore(/* options */);

irma.use(/* Plugin A */);
irma.use(/* Plugin B */);

irma.start();

You can pass an options object to the constructor, which will be passed on to each plugin that you register. Each plugin can choose which of your options to use or ignore.

const irma = new IrmaCore({
  debugging: true,            // Used by state machine and multiple plugins
  element:   '#irma-web-form' // Used by `irma-web` plugin
});

The start method starts the state machine and returns a Promise. Whatever parameters you pass to the start method get passed to the start method of the plugins too, but no plugins currently make use of that.

irma.start()
    .then(result => console.log("Successful disclosure! 🎉", result))
    .catch(error => console.error("Couldn't do what you asked 😢", error));

This Promise only resolves when the state machine reaches the Success state and only rejects when the machine reaches the BrowserNotSupported state. In the latter case, plugins may already inform the user of this issue, so please test if you need to catch this state yourself. You may wish to fall back to another authentication method automatically by catching the rejection and redirecting the user.

FAQs

Last updated on 05 Mar 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc