> ## Documentation Index
> Fetch the complete documentation index at: https://docs.datavibe.cc/llms.txt
> Use this file to discover all available pages before exploring further.

# TypeScript SDK

> Gate AI-generated outbound with the official DataVibe TypeScript SDK.

## Install

```bash theme={null}
npm install @datavibe.cc/sdk
```

## Persisted production gate

```typescript theme={null}
import { DataVibeClient } from "@datavibe.cc/sdk";

const datavibe = new DataVibeClient({
  apiKey: process.env.DATAVIBE_API_KEY!,
});

const result = await datavibe.intercept({
  recipient: "prospect@example.com",
  subject: "Following up",
  body_text: "Hi Jordan, checking in.",
  body_html: "<p>Hi Jordan, checking in.</p>",
  source_model: "gpt-4o",
  idempotency_key: "campaign-42-send-1001",
});

if (result.status === "BLOCKED" || result.status === "FAILED") {
  throw new Error(`Do not send: ${result.status}`);
}

if (result.status === "QUEUED" || result.status === "DISPATCHING") {
  console.log("Hold submission:", result.action_id, result.review_url);
  return;
}

console.log("Released:", result.action_id);
```

## Stateless preview

```typescript theme={null}
const preview = await datavibe.check({
  content: "AI-generated text",
  contentType: "email",
  sourceModel: "gpt-4o",
});
```

`check()` returns a verdict only. If it returns `review_required`, call
`intercept()` to create a persisted review item.

## Generate and check in one call

`datavibe.generateAndCheck({ messages })` has DataVibe call the LLM itself
(your workspace's shared key or your BYOK key, configured in Settings → AI
Provider), then governance-check the output. No LLM key is ever passed in
the request. Use this when you want DataVibe to own generation, not just the
gate.

<Warning>
  Use the exact status strings returned by the SDK. Do not lowercase them or treat
  every non-blocked status as safe.
</Warning>
