CrispHiveDOCS
SDKsQuickstart

SDK Quickstart

Coming soon

Typed clients that wrap the CrispHive REST API with idiomatic methods, automatic retries, and built-in pagination. Packages are publishing shortly — every snippet below is final and copiable today.

Install

Add the SDK to your project. Registry publish is pending — the command is reserved.

npm i @crisphive/sdk

Initialize the client

Pass your API key and target environment. The environment selects the matching base URL and validates the key prefix.

import { CrispHive } from "@crisphive/sdk";

const client = new CrispHive({
  apiKey: process.env.CRISPHIVE_API_KEY, // chsk_test_… or chsk_live_…
  environment: "sandbox",                // "live" | "sandbox"
});

List customers

Maps to GET /customers. Filters are typed; the response is unwrapped from the envelope automatically.

const { data } = await client.customers.list({
  tier: "vip",
  status: "active",
  limit: 25,
});

for (const customer of data.customers) {
  console.log(customer.id, customer.name);
}

Create a booking

Maps to POST /job-requests. Nested objects are fully typed, including date windows and periods.

const { data } = await client.bookings.create({
  customerId: "cus_01HF8Z2K9QXR",
  serviceId:  "svc_ac_repair",
  priority:   "priority",
  location: {
    line1: "418 W 5th St",
    city:  "Austin",
    region: "TX",
    postalCode: "78701",
  },
  jobDates: [
    { date: "2026-07-02", periods: ["morning", "afternoon"] },
  ],
});

console.log("Booking created:", data.id);