npm install --save dots-wrapper@latest
import { createApiClient } from 'dots-wrapper';
const myApiToken = 'my-long-token';
const dots = createApiClient({token: myApiToken});
const main = async () => {
const {data:{account}} = await dots.account.getAccount();
console.log(account);
};
main();
const {createApiClient} = require('dots-wrapper');
const myApiToken = 'my-long-token';
const dots = createApiClient({token: myApiToken});
const main = async () => {
const {data:{account}} = await dots.account.getAccount();
console.log(account);
};
main();
index.html
<script src='https://unpkg.com/dots-wrapper@latest/dist/index-browser.min.js'></script>
js.js
const {createApiClient} = window.dots;
const myApiToken = 'my-long-token';
const dots = createApiClient({token: myApiToken});
const main = async () => {
const {data:{account}} = await dots.account.getAccount();
console.log(account);
};
main();