Carbon LogoCarbon
API Clients

TypeScript Client

Lightweight TypeScript client for implementing Carbon in your app

A lightweight Supabase client for calling the Carbon API from TypeScript or JavaScript projects.

Installation

Terminal
npm install @supabase/supabase-js
# or
pnpm add @supabase/supabase-js
# or
yarn add @supabase/supabase-js

Usage

index.ts
import { createClient } from '@supabase/supabase-js'

const apiKey = process.env.CARBON_API_KEY
const apiUrl = process.env.CARBON_API_URL
const publicKey = process.env.CARBON_PUBLIC_KEY

const carbon = createClient(apiUrl, publicKey, {
  global: {
    headers: {
      "carbon-key": apiKey,
    },
  },
});

const result = await carbon.from("employees").select("*");

Client Reference

See the official supabase javascript client documentation for more information.

API Reference

See the Carbon API Reference for more information.

Code Examples