@laduke/zerotier-central-client

0.3.3 • Public • Published

ZeroTier Central API client

(my.zerotier.com)

Bring your own fetch. No dependencies, pure functions, etc

Install

npm install @laduke/zerotier-central-client

Usage

In node you need the api access token from my.zerotier.com. In the browser it'll use cookies, so no token required. This doesn't depend on any of the many fetch/request modules out there, but returns objects that should be easy to pass into any of them.

  const optz = { token: process.env.API_TOKEN }

  const axios = require('axios').default
  const result = await axios(central.statusGet(optz))
  console.log(result)

  const fetch = require('node-fetch')
  const { url, ...opts } = central.statusGet(optz)
  const result2 = await fetch(url, opts).then(res => res.json())
  console.log(result2)

TODO

  • [ ] jsdoc

/@laduke/zerotier-central-client/

    Package Sidebar

    Install

    npm i @laduke/zerotier-central-client

    Weekly Downloads

    0

    Version

    0.3.3

    License

    MIT

    Unpacked Size

    22.3 kB

    Total Files

    11

    Last publish

    Collaborators

    • laduke