Skip to content

careerboard/api-client

Repository files navigation

@careerboard/api-client

Typed Node.js client for the Careerboard Public API.

The package is meant to be installed directly from GitHub and already ships with prebuilt dist, so consumers do not need a separate build step.

Install

npm install github:careerboard/api-client
pnpm add github:careerboard/api-client
yarn add careerboard/api-client

Quick start

import { createCareerboardClient } from "@careerboard/api-client";

const client = createCareerboardClient(process.env.CAREERBOARD_API_KEY!);

const me = await client.auth.me();
const projects = await client.projects.list();

By default the client talks to:

https://api.careerboard.leverton.dev

Override it when you need a different environment:

import { createCareerboardClient } from "@careerboard/api-client";

const client = createCareerboardClient({
  apiKey: process.env.CAREERBOARD_API_KEY!,
  baseUrl: "http://localhost:3000",
  timeout: 30_000,
});

Auth

Only an API key is required. The client automatically sends it as the x-api-key header.

You can rotate the key without recreating the client:

client.setApiKey(process.env.CAREERBOARD_API_KEY_NEXT!);

Shape of the SDK

The wrapper returns parsed response bodies instead of raw Axios responses.

Main entry points:

  • client.auth.me()
  • client.status.get()
  • client.tasks.get({ taskId })
  • client.billing.getBalance()
  • client.billing.listUsageCharges(query)
  • client.projects.list()
  • client.projects.getProgressBoard({ projectId })
  • client.projects.vacancyScraping.listResults({ projectId }, params?)
  • client.progressBoard.items.get({ itemId })
  • client.progressBoard.items.tailoredResume.generate({ itemId }, body)
  • client.progressBoard.items.coverLetter.exportPdf({ itemId })
  • client.tailoredResumes.photo.createUpload({ resumeId }, body)
  • client.vacancyScraping.runSource({ sourceId })

If you need the generated client directly, use:

const rawResponse = await client.raw.publicApi.projectsList();
const body = rawResponse.data;

You also have direct access to the configured Axios transport through client.transport.

Exports

The package exports:

  • createCareerboardClient(...)
  • createClient(...)
  • DEFAULT_CAREERBOARD_API_BASE_URL
  • the full generated public API types and classes from src/generated/public-api.ts

Local development

Sync the generated source from the backend checkout:

npm run sync:generated

Build the library:

npm run build

Type-check the source:

npm run typecheck

Build output

npm run build produces:

  • dist/index.js for ESM consumers
  • dist/index.cjs for CommonJS consumers
  • dist/index.d.ts for TypeScript consumers

The bundle targets Node.js 16+ and is suitable for installing straight from GitHub.

API docs