DoDomain

SDKs

The @dodomain/node server SDK and the @dodomain/connect browser widget — both open source on npm.

DoDomain ships two SDKs, both published on npm, MIT-licensed, with zero runtime dependencies (dual ESM + CJS builds with self-contained type declarations). Raw HTTP against the REST API stays fully supported — the SDKs are conveniences over the same shapes.

@dodomain/node — the server SDK

npm install @dodomain/node

Your server uses it to mint connect sessions and verify webhooks:

import { DoDomain, verifyWebhook } from "@dodomain/node";

const dodomain = new DoDomain({ secretKey: process.env.DODOMAIN_SECRET_KEY });

// Mint a session — schema-validated input and output
const session = await dodomain.sessions.create({
  domain: "app.customer.com",
  records: [{ type: "CNAME", host: "app", value: "cname.yourproduct.com" }],
});
// session.connectUrl → hand to your user

// Verify an incoming webhook (header: x-dodomain-signature, "t=<ms>,v1=<hex>")
const ok = verifyWebhook(secret, rawBody, signatureHeader);

Keep the secret key server-side only — it must never reach a browser.

@dodomain/connect — the browser widget

npm install @dodomain/connect

An embeddable widget that opens the hosted connect flow in a modal iframe on your own page:

import { showDoDomain } from "@dodomain/connect";

showDoDomain({
  token: session.token, // from your server's sessions.create call
  onVerified: () => location.reload(),
});

If you'd rather write no frontend code at all, skip the widget and just link or redirect your user to session.connectUrl — it is the same flow as a full page.

Source and issues

The SDK source is developed in the DoDomain monorepo and mirrored read-only at DevinoSolutions/dodomain-sdk, which also hosts external issues.

On this page