Package Exports
- @keystonehq/sdk
- @keystonehq/sdk/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@keystonehq/sdk) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@keystonehq/sdk
@keystonehq/sdk
is library for helping developer to do integration with Keystone.
the main purpose is to encode and decode data for QR Code usage.
currently we use UR to encode data. check this for detail info about UR
Install
yarn add @keystonehq/sdk
npm install --save @keystonehq/sdk
Usage
import sdk from '@keystonehq/sdk';
const read = async () => {
const result = await sdk.read();
}
const play = async () => {
await sdk.play("any data string");
}
API
Name | Parameters | result | Description |
---|---|---|---|
read | Promise<{type: 'text' | 'json' | 'ur', data: string} | null> | Open a modal and read qrcode with camera, will return null when click Close button | |
play | data: string, options?: {refreshSpeed?: number} | Promise |
Open a modal and display a dynamic qrcode, will resolve when click Finish button |