npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

airbitz-core-js-ui

v0.1.7

Published

Airbitz login UI components, as a library

Downloads

53

Readme

Airbitz Javascript UI

This repo implements a UI layer on top of airbitz-core-js to provide web applications the interface required to do all the accounts management in just a small handful of Javascript API calls. All UI operates in an overlay iframe on top of the current HTML view.

Build from source repo (not needed if using NPM)

npm install to fetch the dependencies. npm run build to create the web bundle.

Or just use the NPM package from your own repo

npm install airbitz-core-js-ui --save

Basic usage

Get an API key from

https://developer.airbitz.co

You'll need an account on the Airbitz Mobile App which you can download for iOS and Android at

https://airbitz.co/app

On the developer.airbitz.co page, scan the QR code using the Airbitz Mobile App after signing in and register an email address.

Install from npm

npm install airbitz-core-js-ui --save

Include the abcui.js file in your code (using Webpack or any other bundler of your choice):

var abcui = require('airbitz-core-js-ui')

Now start diving in and make some calls

Initialize the library

_abcUi = abcui.makeABCUIContext({'apiKey': 'api-key-here',
                                 'appId': 'com.mydomain.myapp',
                                 'assetsPath': '/path-to-assets/',
                                 'vendorName': 'My Awesome Project',
                                 'vendorImageUrl': 'https://mydomain.com/mylogo.png'});

where /path-to-assets/ tells the UI where to find the contents of the assets directory of this node module via HTTP. When updating this node module, you must keep the assets directory up-to-date on your server. We suggest automating this using NPM scripts or any other tool or your choice.

Create an overlay popup where a user can register a new account or login to a previously created account via password or PIN.

_abcUi.openLoginWindow(function(error, account) {
  _account = account;
});

Login UI

Launch an account management window for changing password, PIN, and recovery questions

_abcUi.openManageWindow(_account, function(error) {

});

Manage UI

Get or create a wallet inside of the account

_abcUi.openLoginWindow(function(error, account) {
  _account = account;

  // Get the first wallet in the account that matches our required wallet type
  const abcWallet = account.getFirstWallet('wallet:repo:ethereum');
  if (abcWallet == null) {
    // Create an ethereum wallet if one doesn't exist:
    const keys = {
      ethereumKey: new Buffer(secureRandom(32)).toString('hex')
    }
    account.createWallet("wallet:repo:ethereum", keys, function (err, id) {
      if (err) {
        // Yikes. This shouldn't fail except for network or disk errors
      } else {
        _wallet = account.getWallet(id)
        _key = _wallet.keys.ethereumKey
        // Update your UI here
      }
    })
  } else {
    _wallet = abcWallet
    _key = _wallet.keys.ethereumKey
    // Update your UI here
  }
}

_key can then be used as a secure source of entropy for this wallet within your app

Logoff a user

_account.logout();

Sample website repo

See a sample implementation at airbitz-core-js-sample

Test server

Besides the production authentication servers, Airbitz also maintains a test authentication server with a completely separate account namespace. If you would like to use this server for testing, rather than the production server, please run the following code:

localStorage.setItem('airbitzAuthServer', 'https://test-auth.airbitz.co/api')

Please note that we occassionally wipe out the test server, so please don't store any vauable assets on there.

Detailed Docs

https://developer.airbitz.co/javascript/#airbitz-account-management-ui