Below describes SDK v2 beta, for v1, see here.
If using npm:
npm install token-io
If using yarn:
yarn add token-io
const TokenIO = ;const Token = env: 'sandbox';
;const Token = env: 'sandbox';
If not using as a module, then include it as a script:
This will provide you with the
TokenIO global object.
We provide typing support for the API through Flow.
If you choose to integrate Flow into your project, you can use the following command as a type checker:
npm run flow check
# targets dev environment by defaultnpm test# for other envs (local, dev, stg, sandbox, prd)ENV=sandbox npm test
# targets dev environment and Chrome by defaultnpm run testBrowser# for other envs (local, dev, stg, sandbox, prd) or browsers (Chrome, Firefox, Safari, IE, Edge)ENV=sandbox npm run testBrowser -- --browsers Safari
Make sure you have recent versions of Node and npm.
To install dependencies:
npm run build # CommonJS and ES6 distributions for both Node and browser