npm install zinid-react
or with yarn
yarn add zinid-react
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
// 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} />
</>
);
};
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 |