JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 11
  • Score
    100M100P100Q78993F
  • License MIT

A template for creating npm packages using TypeScript and VSCode

Package Exports

  • @dustid/dust-go
  • @dustid/dust-go/lib/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 (@dustid/dust-go) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@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

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