Skip to main content Link Search Menu Expand Document (external link)


Table of Contents

  1. Script from CDN
  2. NPM and Bundlers

Script from CDN

Include the Hub API library as a script in your page:

  integrity="sha256-5X6zryCUAPOnfjLU8tEtJrLdcslA2UI27RsUWnLAxHs=" crossorigin="anonymous"></script>

This will make the HubApi object available globally on your site.

You can also import from the CDN as an ES6 module:

<script type="module">
  import HubApi from '';

  // Your code here...

NPM and Bundlers

The Hub API can be installed from NPM to use with bundlers (for example Webpack, Rollup, etc.):

npm install --save @nimiq/hub-api
# or with yarn
yarn add @nimiq/hub-api

Then simply import or require it in your module:

import HubApi from '@nimiq/hub-api';
// or
const HubApi = require('@nimiq/hub-api');

Next: Usage