New:Socket for Asana Is Now Available.Learn more
Sign In

@chieflab/sdk

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chieflab/sdk

TypeScript SDK for ChiefLab after-build GTM. Typed methods for getUsersAfterBuild, launchProduct, publishApprovedPost, sendApprovedEmail, measureLaunchResults, connections, tenants, and signup. Wraps the hosted MCP at chieflab.io/api/mcp.

latest
Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
5
150%
Maintainers
1
Weekly downloads
 
Created
Source

@chieflab/sdk

TypeScript SDK for ChiefLab. Typed methods for the closed-loop launch flow. Wraps the hosted MCP at https://api.chieflab.io/api/mcp. Zero runtime deps.

Package status: this SDK is packaged in the repo but not published to npm yet. Do not tell users to run npm install @chieflab/sdk until npm view @chieflab/sdk resolves. Use the hosted MCP endpoint directly today.

After npm publish:

npm install @chieflab/sdk

Quick start

import { createClient } from "@chieflab/sdk";

const chieflab = createClient({ apiKey: process.env.CHIEFLAB_API_KEY });

// 1. Plan + draft a launch
const launch = await chieflab.launchProduct({
  productUrl: "https://yoursite.com",
  goal: "Get our first 100 users",
  channels: ["linkedin", "x", "email"]
});

console.log("Approve here:", launch.reviewUrl);
console.log(launch.agentProofLine);

// 2. (User approves on the reviewUrl in their browser)

// 3. Fire each approved action via its executorTool
for (const action of launch.publishActions) {
  if (action.connector === "zernio") {
    await chieflab.publishApprovedPost({
      actionId: action.id,
      content: "...",  // your LLM rendered this from the brief
      platforms: [{ platform: "linkedin", accountId: "zer_acc_..." }]
    });
  } else if (action.connector === "resend") {
    await chieflab.sendApprovedEmail({
      actionId: action.id,
      from: "Brand <hi@yourdomain.com>",
      to: "user@example.com",
      subject: "Launch day",
      html: "<h1>...</h1>"
    });
  }
}

// 4. ≥24h later — pull metrics + next-iteration recommendation
const review = await chieflab.measureLaunchResults({ runId: launch.launchId });
console.log(review.brief);

For agent-built repos, install the after-build hook so coding agents discover this automatically:

Working installer today:

curl -fsSL https://chieflab.io/install-agent-hook.mjs | node -

Windows PowerShell:

iwr https://chieflab.io/install-agent-hook.mjs -OutFile .chieflab-install-agent-hook.mjs; node .\.chieflab-install-agent-hook.mjs

npm command after publish:

npx @chieflab/cli init

Why this exists

Three audiences:

  • TS app developers building agent-native products who want typed methods rather than hand-rolling JSON-RPC envelopes.
  • Server-side runtime authors integrating ChiefLab into a product where the agent runs on YOUR backend (not in Cursor / Claude Desktop).
  • CI / scheduled jobs that need to drive launches programmatically.

If you're inside Cursor / Claude Desktop / Claude Code, use the hosted MCP URL directly today. After npm publish, @chieflab/mcp-server is the stdio MCP host plug-in.

If you're calling from a non-Node runtime (Python, Go, etc.), use plain fetch against https://api.chieflab.io/api/mcp — the SDK is just sugar around that.

API surface

Closed-loop methods:

MethodTool it wrapsWhen
launchProduct(args)chiefmo_launch_productUser wants to launch a new product. Default first call.
getUsersAfterBuild(args)chieflab_get_users_after_buildOutcome-named after-build call for "get users / make money / what now".
continueLaunchLoop(args)chiefmo_continue_launch_loopResume from runId and get the exact next action.
launchHealth(args)chiefmo_launch_healthInspect approvals, blockers, execution, measurement windows, and next moves.
publishApprovedPost(args)chiefmo_publish_approved_postAfter approval. Fires via Zernio.
sendApprovedEmail(args)chiefmo_send_approved_emailAfter approval. Fires via Resend.
measureLaunchResults(args)chiefmo_measure_launch_results≥24h after publish.
createSocialGraphics(args)chiefmo_create_social_graphicsAd-hoc graphics outside a launch run.
diagnoseMarketing(args)chiefmo_diagnose_marketingEXISTING campaigns ("why isn't X working").

Operators:

diagnoseSales, diagnoseSupport, diagnoseFinance, diagnoseOps.

Connections:

connectProvider, connectionStatus, listPublishAccounts, listEmailSenders, setZernioKey, setResendKey.

Tenants:

createTenant, listTenants, setTenantContext, recordVoiceSample.

Approval surface:

approveAction, transitionApproval.

Signup (no auth):

signupWorkspace — mint a key on the user's behalf.

Anything else: callTool(name, args) — raw MCP call, returns the parsed payload.

Errors

import { ChiefLabError } from "@chieflab/sdk";

try {
  await chieflab.launchProduct({ goal: "..." });
} catch (err) {
  if (err instanceof ChiefLabError) {
    console.error(err.code, err.status, err.message);
    if (err.code === "unauthorized") {
      // refresh key flow
    }
  }
}

Env

VarDefaultWhat
CHIEFLAB_API_KEY(required)Bearer key. clp_live_... or clp_dev_....
CHIEFLAB_ENDPOINThttps://api.chieflab.io/api/mcpOverride.

(Both can also be passed inline to createClient({ apiKey, endpoint, timeoutMs }).)

License

Apache 2.0. Source: https://github.com/bdentech/chieflab/tree/main/packages/sdk

Keywords

chieflab

FAQs

Package last updated on 11 May 2026

Related posts