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

@gimly-blockchain/gimlyid-qr-code-generator

v0.2.0

Published

A QR generator component for Gimly ID

Downloads

4

Readme

A GimlyID QR code generator component. This library works with React and React Native (using React Native SVG). It is a simple way to generate a QR code with a unique state value when you request a page that has the component installed.

Example

import React from 'react';
import ReactDOM from 'react-dom';
import GimlyIDQRCode, {QRType, QRMode} from '@gimly-blockchain/gimlyid-qr-code';

ReactDOM.render(<GimlyIDQRCode 
                 type={QRType.AUTHENTICATION} 
                 did={'did:ethr:0xcBe71d18b5F1259faA9fEE8f9a5FAbe2372BE8c9'} 
                 mode={QRMode.DID_AUTH_SIOP_V2}
                 redirectUrl={'https://example.com'}
                 onGenerate={content => console.log(JSON.stringify(content))}
               />);

/*
Example output of onGenerate:
{"state":"vqKLNzmYYPDmt8YWs9ftYE","type":"auth","did":"did:ethr:0xcBe71d18b5F1259faA9fEE8f9a5FAbe2372BE8c9","mode":"didauth","redirectUrl":"https://example.com","qrValue":"{\"state\":\"vqKLNzmYYPDmt8YWs9ftYE\",\"type\":\"auth\",\"did\":\"did:ethr:0xcBe71d18b5F1259faA9fEE8f9a5FAbe2372BE8c9\",\"mode\":\"didauth\",\"redirectUrl\":\"https://example.com\"}"}
*/

API

| prop | type | default value | description | | ----------------------- | ---------------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | type | QRType | | This is the type stored within the QR code. Options: [AUTHENTICATION]. | | did | string | | This is the DID that the relying party (the party that integrated the authentication support on their website) will use to sign/encrypt data towards the client. This will be stored within the QR code. | | mode | QRMode | | This is the mode stored within the QR code. Options: [DID_AUTH_SIOP_V2]. | | redirectUrl | string | | This is a redirect url that will be stored within the QR code. | | bgColor (optional) | string | '#FFFFFF' | This will set the background color of the QR code. | | fgColor (optional) | string | '#000000' | This will set the foreground color of the QR code. | | level (optional) | string ('L' 'M' 'Q' 'H') | 'L' | This will set the level of the QR code. | | size (optional) | number | 256 | This will set the size of the QR code. | | title (optional) | string | | This will set the title of the QR code. | | onGenerate (optional) | Function | | onGenerate will be called when the QR code is generated and will have access to the QR content. |

DID Auth SIOP

The purpose of this QR code is to initiate the authentication between two parties by redirecting to an endpoint that returns an Authentication Request using using the DID Auth SIOP library. The DID Auth SIOP library is an authentication library for having clients/people conforming to the Self Issued OpenID Provider v2 (SIOPv2) and OpenID Connect for Verifiable Presentations (OIDC4VP) as specified in the OpenID Connect working group.

Installation

yarn add @gimly-blockchain/gimlyid-qr-code

When using this library with React Native, you will also need to have react-native-svg installed.

yarn add react-native-svg
cd ios && pod install

Build

yarn build

Test

The test command runs:

  • eslint
  • prettier
  • jest
  • coverage

You can also run only a single section of these tests, using for example yarn test:unit.

yarn test

Utility scripts

There are other utility scripts that help with development.

  • yarn fix - runs eslint --fix as well as prettier to fix code style.