Skip to content
This repository has been archived by the owner on May 15, 2021. It is now read-only.
/ share-kit-react Public archive

↗️ Easily allow your users to share their verified personal information directly with your application

License

Notifications You must be signed in to change notification settings

hellobloom/share-kit-react

Repository files navigation

⚠️ Notice ⚠️

This library is no longer maintained, please use ssi-sdk instead.

Share Kit React

Important: This repository is no longer maintained. It has been moved to the attestations-es monorepo.

Share Kit React

React wrapper for Share Kit

Installation

npm install --save @bloomprotocol/share-kit-react

Usage

RequestElement will render a QR code or button based on the client's platform. By defualt it will render a button when the client is mobile or tablet and on iOS.

import * as React from 'react'
import {RequestElement, RequestData, QROptions, ButtonOptions} from '@bloomprotocol/share-kit-react'

const requestData: RequestData = {...}
const buttonOptions: ButtonOptions = {
  callbackUrl: 'https://mysite.com/bloom-callback',
}

<RequestElement
  requestData={requestData}
  buttonOptions={buttonOptions}
/>

// Setting QR Options

const qrOptions: Partial<QROptions> = {
  size: 200,
}

<RequestElement
  requestData={requestData}
  buttonOptions={buttonOptions}
  qrOptions={qrOptions}
/>

// Overriding shouldRenderButton
<RequestElement
  requestData={requestData}
  buttonOptions={buttonOptions}
  shouldRenderButton={(parsedResult) => {
    if (parsedResult.platform.type === 'mobile') return true

    return false
  }}
/>

// Passing props to the container
<RequestElement
  requestData={requestData}
  buttonOptions={buttonOptions}
  className="request-element-container"
/>

More

For more information and documentation see Share Kit

About

↗️ Easily allow your users to share their verified personal information directly with your application

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •