@basetime/a2w-scanner-ts
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

a2w-scanner-ts

SDK for embedded apps running inside the atw scanner webview.

Installation

npm install @basetime/a2w-scanner-ts

Usage

import { WebApp } from '@basetime/a2w-scanner-ts';

const webApp = new WebApp();

// Listen for scan events from the scanner.
webApp.on('scan', (message) => {
  console.log(message);
});

// Send a message to the scanner to navigate to the scan screen.
webApp.send({ action: 'navigate', payload: 'scan' });

Alternatively, you import the WebApp class directly from the CDN:

<script type="module">
  import WebApp from 'https://cdn.addtowallet.io/js/scanner/v0.0.3/WebApp.js';

  const webApp = new atw.WebApp();

  // Listen for scan events from the scanner.
  webApp.on('scan', (message) => {
    console.log(message);
  });

  // Send a message to the scanner to navigate to the scan screen.
  webApp.send({ action: 'navigate', payload: 'scan' });
</script>

Readme

Keywords

none

Package Sidebar

Install

npm i @basetime/a2w-scanner-ts

Weekly Downloads

3

Version

0.0.3

License

UNLICENSED

Unpacked Size

53.5 kB

Total Files

25

Last publish

Collaborators

  • basetime-io
  • anthonyzupancic
  • web-headzoo