Netzo SDK

A JavaScript/TypeScript SDK for interacting with resources in Netzo and with the Netzo API.

Features

  • 🚀 Productive: flexible and easy to use
  • 🪽 Lightweight (~36 loc)
  • 🦾 Strongly typed
  • 📚 Intuitive: chain/bracket syntax and methods
    • api.users(1).get()
    • api.users["1"].post({...})

The SDK uses ofetch for data fetching under the hood. Thus, every option available for ofetch is usable as well. This SDK extends uncreate for Netzo.

Documentation

Refer to the Netzo documentation for more details.

Usage

import { Netzo } from 'https://deno.land/x/netzo/mod.ts'

const netzo = Netzo(Deno.env.get('NETZO_API_KEY'))

// create client for existing resource:
const { client } = await netzo.getResource(RESOURCE_ID)
const users = await client.users.get()

// create client for a custom HTTP resource:
const { client } = netzo.getResource({
  baseURL: 'https://jsonplaceholder.typicode.com',
})
const users = await client.users.get()

// api: an authenticated client for the Netzo API
const projects = await netzo.api.projects.get()

License

Copyright (c) 2023 Netzo

Licensed under the MIT license.