zinid-react
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

zinid-react



zinid logo

ZinId single sign on and KYC verification for React.


💾 Installation

npm install zinid-react

or with yarn

yarn add zinid-react


📄 Usage

This library can be implemented into any react application for sign in, sign up and KYC verification by using a button provided by the library for each case

1. Sign in using the zinid signin button

// Import ZinIdSignInButton component
import {ZinIdSignInButton} from "zinid-react"

// Use it in your code like so
export const MyComponent = () => {

  const sdkToken = "your_unique_sdk_token_generated_on_the_zinid_vendor_website"

       // you can call this function anything
    const handleZinidSigninSuccess = (data) => {
      // Implementation for whatever you want to do with data and after success call.
      console.log(data);
    };


  return (
    <>
      <ZinIdSignInButton  className="mt-2" sdkToken={sdkToken} onSuccess={handleZinidSigninSuccess} />
    </>
  );
};


🪄 Props for the ZinId Signin Button

Here's a table of all available props for the ZinIdSignIn Button.



Required Prop Description Type default
sdkToken SDK token which is unique to every vendor. This token can be generated on the Zinid vendor app string
  onSuccess Callback fires with credential response after successfully sign in. (response: {data:{email: "user@email.com", first_name: "user_first_name", zinid:"user_zinid"}, success: true}) => void
  text Sets the button text. string Sign in with ZinID
  className Custom classname for the button string
  disabled Boolean Condition to disable button boolean


Package Sidebar

Install

npm i zinid-react

Weekly Downloads

3

Version

1.0.3

License

ISC

Unpacked Size

791 kB

Total Files

12

Last publish

Collaborators

  • zinary-analytica-limited