Getting started
From zero to your first export.
Six steps. Everything below is real, copyable code against the actual API — not pseudocode. Full reference in the docs.
Sign up
Create a workspace — it takes a minute and creates your organization automatically.
Create an API key
Open API Keys in the dashboard and create one. The full key is shown exactly once — copy it now.
# .env
DATAEGRESS_API_KEY=dte_live_...Initialize the SDK
One package, no framework lock-in. The key is sent automatically as Authorization: Bearer <key> — no headers to build by hand.
npm install @dataegress/sdkimport { DataEgress } from "@dataegress/sdk";
const dataEgress = new DataEgress({
apiKey: process.env.DATAEGRESS_API_KEY,
});Register a dataset
Define the callback DataEgress will call to fetch your data — your own query, your own tenant isolation. DataEgress never connects to your database directly. Then register its URL. Testing locally? DataEgress can’t reach localhost — see the quickstart for exposing a local server with a tunnel, then validating the connection before you export.
import { defineDataset } from "@dataegress/sdk";
const transactions = defineDataset({
id: "transactions",
fetchPage: async ({ tenantId, cursor, limit }) => {
const rows = await db.transaction.findMany({
where: { tenantId, id: { gt: cursor ? Number(cursor) : 0 } },
orderBy: { id: "asc" },
take: limit,
});
return {
rows,
nextCursor: rows.length < limit ? null : String(rows.at(-1)!.id),
};
},
});
export const POST = transactions.handler(); // mount at e.g. /api/dataegress/transactionsawait dataEgress.registerDataset({
id: "transactions",
fetchUrl: "https://your-app.com/api/dataegress/transactions",
});Add a destination
Choose where your customer receives the export. No bucket yet? Use signed_url — zero setup, DataEgress hosts the file. Or point straight at a bucket your tenant owns; you can also do this from the dashboard instead of code.
await dataEgress.createDestination({
tenantId: "acme",
id: "acme-s3",
type: "s3", // or "signed_url" for zero setup
s3: {
bucket: "acme-data-lake",
region: "us-east-1", // "auto" for Cloudflare R2
accessKeyId: "...",
secretAccessKey: "...",
},
});Run your first export
Pick the dataset, the destination, a format, and which tenant it’s for. You can also trigger this from the dashboard instead of code.
const run = await dataEgress.runExport({
tenantId: "acme",
dataset: "transactions",
destination: "acme-s3",
format: "parquet",
});
// poll until it's done
let result = run;
while (result.status === "pending" || result.status === "running") {
await new Promise((r) => setTimeout(r, 1000));
result = await dataEgress.getExport(run.id);
}That’s the whole integration.
DataEgress runs the delivery, retries and manifests — there’s no queue or worker to operate on your side. Once this works, add a schedule to automate it. Questions, or need a custom limit or BYOC setup?