Installation
The SDK is a lightweight, typed API client built on fetch. It works in Node.js and Bun.
Install
Section titled “Install”The SDK is a workspace package within the Codecosts monorepo. If you’re working within the monorepo, it’s already available:
import { createClient } from '@codecosts/sdk';Configure
Section titled “Configure”Create a client instance with your Codecosts server URL and a Codecosts API key:
const client = createClient({ baseUrl: 'https://codecosts.com', apiKey: 'sk_your_api_key',});For local development:
const client = createClient({ baseUrl: 'http://localhost:3016', apiKey: 'sk_your_api_key',});