1.3.4 • Published 1 year ago

@bluecheck/react-library v1.3.4

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

React Blue Check Component

A React component that integrates with Blue Check to verify credentials in a privacy-preserving way.

Installation

npm install @bluecheck/react-library

Or

yarn add @bluecheck/react-library

Usage

import { EmploymentVerification, EmploymentProof } from '@bluecheck/react-library'

const [showVerification, setShowVerification] = useState(true);
const handleProofVerified = (proof: EmploymentProof) => {
    console.log(proof);
}

const handleClose = () => {
    setShowVerification(false);
};

const styles = {
    QRLightColor:"#AB552F",
    QRDarkColor:"#1E1E1E",
    borderHoverColor: '#AB552F',
    backgroundColor: '#1E1E1E',
    borderColor: '#949494',
    textColor: 'white',
    fontType: "Hahmlet",
}

{showVerification && <EmploymentVerification
    appId="app-id"
    onProofVerified={handleProofVerified}
    onClose={handleClose}
    styles={styles}
/>}

Props

PropTypeDescription
appIdstringYour Reclaim Protocol application ID
onProofVerified(proof: Proof) => voidCallback function that receives the verification proof
onClose() => voidOptional callback function triggered when the verification process is closed
styles{ borderHoverColor?: string; backgroundColor?: string; borderColor?: string; textColor?: string; fontType?: string QRLightColor?: string QRDarkColor?: string }Optional object for customizing component styles

Usage

import { EcommerceVerification, EcommerceProof } from '@bluecheck/react-library'

const [showVerification, setShowVerification] = useState(true);
  const handleProofVerified = (proof: Proof) => {
    console.log(JSON.parse(proof.userData));
    setProof(proof);
  };

const handleClose = () => {
    setShowVerification(false);
};

const styles = {
    QRLightColor:"#AB552F",
    QRDarkColor:"#1E1E1E",
    borderHoverColor: '#AB552F',
    backgroundColor: '#1E1E1E',
    borderColor: '#949494',
    textColor: 'white',
    fontType: "Hahmlet",
}

{showVerification && <EcommerceVerification
    appId="app-id"
    onProofVerified={handleProofVerified}
    onClose={handleClose}
    styles={styles}
/>}

Props

PropTypeDescription
appIdstringYour Reclaim Protocol application ID
onProofVerified(proof: Proof) => voidCallback function that receives the verification proof
onClose() => voidOptional callback function triggered when the verification process is closed
styles{ borderHoverColor?: string; backgroundColor?: string; borderColor?: string; textColor?: string; fontType?: string QRLightColor?: string QRDarkColor?: string }Optional object for customizing component styles

Usage

import { EducationVerification, EducationProof } from '@bluecheck/react-library'

const [showVerification, setShowVerification] = useState(true);
const handleProofVerified = (proof: EducationProof) => {
    console.log(proof);
}

const handleClose = () => {
    setShowVerification(false);
};

const styles = {
    QRLightColor:"#AB552F",
    QRDarkColor:"#1E1E1E",
    borderHoverColor: '#AB552F',
    backgroundColor: '#1E1E1E',
    borderColor: '#949494',
    textColor: 'white',
    fontType: "Hahmlet",
}

{showVerification && <EducationVerification
    appId="app-id"
    onProofVerified={handleProofVerified}
    onClose={handleClose}
    styles={styles}
/>}

Props

PropTypeDescription
appIdstringYour Reclaim Protocol application ID
onProofVerified(proof: Proof) => voidCallback function that receives the verification proof
onClose() => voidOptional callback function triggered when the verification process is closed
styles{ borderHoverColor?: string; backgroundColor?: string; borderColor?: string; textColor?: string; fontType?: string QRLightColor?: string QRDarkColor?: string }Optional object for customizing component styles

Proof Types

Employment Proof

  export interface EmploymentProof {
    bluecheck_session_id: string;
    data: Record<string, string | Record<string, unknown>>;
  }

Ecommerce Proof

export interface EcommerceProof {
    userData: string;
    sessionId: string;
}

Education Proof

  export interface EducationProof {
    bluecheck_session_id: string;
    data: Record<string, string | Record<string, unknown>>;
  }
1.3.4

1 year ago

1.3.3

1 year ago

1.3.2

1 year ago

1.3.1

1 year ago

1.3.0

1 year ago

1.2.9

1 year ago

1.2.10

1 year ago

1.2.8

1 year ago

1.2.7

1 year ago

1.2.6

1 year ago

1.2.5

1 year ago

1.2.4

1 year ago

1.2.3

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.9

1 year ago

1.1.8

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago