anvie / nu-id-qrauth

React component for easy usage of NU.ID with QR-based authorization

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NU.ID QR Auth React Component

The NU.id QR Auth is a Node.js React component library that enables seamless login using NU.id via a QR code. With this library, users can log in to services securely without the need to type in their credentials.

To use the library, you need to install it first. You can do that by running the following command in your terminal:

npm install @nu-id/qr-auth

Once installed, you can import it into your React project and use it to integrate Nu.id authentication into your app.

Here's an example of how you can use the library:

import React from 'react';
import { NuIDQRAuth } from '@nu-id/qr-auth';

const Login = () => {
  const onSuccess = (credentials) => {
    // handle successful login
  };

  const onFailure = (error) => {
    // handle failed login
  };

  return (
    <NuIDQRAuth
      clientId="<your_nu.id_client_id>"
      onSuccess={onSuccess}
      onFailure={onFailure}
    />
  );
};

export default Login;

Make sure to replace <your_nu.id_client_id> with your actual Nu.id client ID.

About

React component for easy usage of NU.ID with QR-based authorization


Languages

Language:TypeScript 100.0%