0.3.3 • Published 3 years ago

@laduke/zerotier-central-client v0.3.3

Weekly downloads
12
License
MIT
Repository
github
Last release
3 years ago

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
0.3.3

3 years ago

0.3.2

4 years ago

0.2.1

4 years ago

0.1.1

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago