Giter Club home page Giter Club logo

sdk's Introduction

HellHub SDK Logo

The Official SDK For The Community Driven HellHub API.

Written 100% in TypeScript, Filter and collect data with full type safety out of the box. Make your life easier and try it today!


CodeQL Tests Bundle Size (Minified) Bundle Size (Minified & Zipped)

What is the HellHub SDK?

The HellHub SDK is a TypeScript library that provides a simple and easy-to-use interface for interacting with the HellHub API. It is designed to make it easy for developers to filter and collect data with full type safety out of the box.

Installation

To install the HellHub SDK, you can use npm, yarn or bun. For simplicity, we will use bun in this example:

bun add @hellhub-collective/sdk

Usage

To use the HellHub SDK, you will need to import the HellHub class from the @hellhub-collective/sdk package.

import HellHub from "@hellhub-collective/sdk";

You can then use the HellHub class to interact with the HellHub API. For example, you can use the planets method to retrieve a single or a list of planets:

// get the planet with id 1
const response = await HellHub.planets(1);

// get a list of all planets
const response = await HellHub.planets();

// get a list of planets with a filter and limit
const response = await HellHub.planets({
  limit: 15,
  filters: { name: { $contains: "Earth" } },
});

Requesting complex endpoints

The HellHub SDK also supports more complex endpoints that require additional parameters. You can also use the request method if you need more control over the request:

import HellHub, { type Planet } from "@hellhub-collective/sdk";

const response = await HellHub.request<Planet[]>("/sectors/1/planets", {
  query: {
    limit: 15,
    filters: { name: { $contains: "Earth" } },
  },
});

Bring your own API

If you are using a self-hosted version of the HellHub API, you can specify the HELLHUB_API_URL environment variable to point to your API endpoint. Note that the value will need to include the /api path.

export HELLHUB_API_URL="https://my-hellhub-api.com/api"

License

This project is licensed under the MIT License. See the LICENSE file for details.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.