0.0.15 • Published 9 months ago

@dustid/dust-go v0.0.15

Weekly downloads
-
License
MIT
Repository
-
Last release
9 months ago

@dustid/dust-go

DUST Go is a prototyping platform that allows developers to create mobile webapps that leverage DUST Identity's platform-dependent functionality without requiring an upfront investment into mobile toolchains.

Install

npm install @dustid/dust-go

Usage

import { connector } from @dustid/dust-go';

const scans: string[] = [];

// Note: connector will be undefined if running outside DUST Go
connector?.addEventListener("scan", ({data}) => {scans.push(data)});
connector?.showScanner();

API

High Level API

scanAsync() => Promise<ScanPayload>

Presents the scanner, and awaits a scan. Rejects if scanner is hidden.

DUST Go Connector

This is a bit lower level, but more powerful.

connector.showScanner() => void

Shows the scanner modal over the main webview.

connector.hideScanner() => void

Hides the scanner modal, returning to the main webview. Note, this can be called even while the webview is in the "background", the webview isn't paused while the scanner is presented.

Events

EventPayload
scan{data: string}
hide{}
connector.addEventListener(event: string, cb: (payload: unknown) => void) => void
connector.hideScanner(event: string, cb: (payload: unknown) => void) => void
0.0.15

9 months ago

0.0.14

10 months ago

0.0.13

10 months ago

0.0.12

11 months ago

0.0.11

11 months ago

0.0.10

11 months ago

0.0.9

11 months ago

0.0.8

11 months ago

0.0.7

11 months ago

0.0.6

11 months ago

0.0.5

11 months ago

0.0.4

11 months ago

0.0.3

11 months ago

0.0.2-development

11 months ago

0.0.1-development

11 months ago

0.0.0-development

11 months ago