@build-it-now/binctl-api
v0.1.6
Published
Typed Node.js API client for the `binctl` backend surface on build-it-now.
Readme
@build-it-now/binctl-api
Typed Node.js API client for the binctl backend surface on build-it-now.
Installation
npm install @build-it-now/binctl-apiUsage
import { BinctlClient } from "@build-it-now/binctl-api";
const client = new BinctlClient({
baseUrl: "https://build-it.now",
token: process.env.BINCTL_TOKEN,
// or apiKey: process.env.BINCTL_API_KEY
});
const projects = await client.projects.list();
console.log(projects);Auth
BinctlClient supports:
- interactive token (
bin_tok_*) - API key (
bin_key_*)
Set either token or apiKey in client options, or later via:
client.setToken(...)client.setApiKey(...)
Main API Surface
auth.loginStart()auth.loginPoll(requestId, { pollCode })auth.status()auth.logout()auth.apiKeys.create/list/revokeprojects.list()projects.create({ name?, orgId? })projects.describe(projectRef)projects.update(projectRef, { name?, mode?, customDomain? })projects.delete(projectRef)projects.branches.list/describe(projectRef, ...)projects.sessions.list(projectRef, { branch? })projects.sessions.create(projectRef, { branchName, name? })projects.orchestrate.start(projectRef, { branch, model })sessions.describe(sessionId)sessions.update(sessionId, { name })sessions.delete(sessionId)sessions.conversation(sessionId)sessions.prompt(sessionId, { message, mode, model })sessions.answerQuestions(sessionId, { answers })sessions.applyRequiredEnvs(sessionId, { envs })
Errors
Non-2xx responses throw BinctlApiError with:
statuspathbody
Project responses expose mode: "greenfield" | "prod", derived from the database-backed projects.backwardsCompatible flag.
