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

# Node SDK

> Express middleware parity with the Python SDK — SQL/Redis/Kafka/S3/queue plugins.

Node mirrors the middleware ↔ control-plane path. Install from the pnpm workspace (not published to npm yet):

```bash theme={null}
pnpm install
pnpm build
```

Packages: `@alibi/sdk-node`, `@alibi/plugin-sql`, `@alibi/plugin-redis`, plus Kafka/S3/queue plugins and `@alibi/domain`.

## Express

```ts theme={null}
import { alibi } from "@alibi/sdk-node";
import { createPostgresPlugin } from "@alibi/plugin-sql";
import { createRedisPlugin } from "@alibi/plugin-redis";
import { createKafkaPlugin } from "@alibi/plugin-kafka";
import { createS3Plugin } from "@alibi/plugin-s3";
import { createQueuePlugin } from "@alibi/plugin-queue";

const sql = createPostgresPlugin({
  connectionString: process.env.DATABASE_URL,
  schema: "alibi_sandbox",
});
const redis = createRedisPlugin({
  url: process.env.REDIS_URL,
  prefix: "alibi:",
  db: 1,
});
const kafka = createKafkaPlugin({ topicPrefix: "alibi." });
const s3 = createS3Plugin({ bucket: "alibi", prefix: "alibi/" });
const queue = createQueuePlugin({ queueName: "orders", prefix: "alibi:" });

alibi.init({ project: "my-service", plugins: [sql, redis, kafka, s3, queue] });
app.use(alibi.middleware());

// In handlers — use wrappers so observe() sees mutations/reads:
await sql.execute("INSERT INTO orders ...", ...);
await redis.set(`order:${id}`, {...});
await kafka.produce("orders", { id });
await s3.put(`receipts/${id}.json`, { total: 9 });
await queue.enqueue({ sku: "latte" });
```

Reference app: `apps/demo-coffee` — start with Compose profile `node` on :4201:

```bash theme={null}
docker compose --profile node up --build
```

## Parity with Python

| Capability | Python | Node |
| - | - | - |
| Middleware off/record/verify + sandbox gate | Yes | Yes |
| Control plane step upload / run report | Yes | Yes |
| SQL observe / snapshot / restore | Yes | Yes (`pg`) |
| Redis observe / snapshot / restore | Yes | Yes (hashes/streams) |
| Kafka / S3 / queue plugins | Yes | Yes (in-memory defaults) |
| Isolation modes 1–6 | Yes | Yes |
| verify-live / approve / re-record | Same CP | Same CP |

Env vars and fail-closed behavior match the [Python SDK](https://alibi.itsdote.tech/examples/sdk-python.md) page.

Full HTTP surface: [API overview](https://alibi.itsdote.tech/api/overview.md) (OpenAPI from control-plane TypeScript routes).\
Full Node API: [SDK Reference](https://alibi.itsdote.tech/sdk/node.md) (generated from `packages/sdk-node`).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.