TypeScript — @scopedpost/sdk 0.1.0
Node ≥ 18. Covers send, get, idempotency keys, and webhook verification.
npm install @scopedpost/sdkLive on npm as @scopedpost/sdk 0.1.0.
SDKs, samples, migration, and the diagnostic MCP server — everything that plugs ScopedPost into something else.
Both SDKs are thin: auth, 429/5xx retry with Retry-After, idempotency keys, and Svix-style webhook verification. Neither invents an endpoint — the contract tests assert every path the SDK calls exists in the OpenAPI spec.
Node ≥ 18. Covers send, get, idempotency keys, and webhook verification.
npm install @scopedpost/sdkLive on npm as @scopedpost/sdk 0.1.0.
Python ≥ 3.9, stdlib only. Same surface as the TypeScript SDK, in lockstep.
pip install scopedpostLive on PyPI as scopedpost 0.1.0.
Not yet in the SDKs: batch send and cancel — call the API directly until the 0.2.0 SDKs add them. See Developers for the endpoint list.
import { ScopedPostClient } from "@scopedpost/sdk";
const client = new ScopedPostClient({
apiKey: process.env.SCOPEDPOST_API_KEY,
});
const { id } = await client.sendEmail({
from: "welcome@your-domain.com",
to: ["ada@example.com"],
subject: "Welcome",
text: "Your first scoped send.",
});
console.log(id); // msg_…import os
from scopedpost import ScopedPostClient
client = ScopedPostClient(api_key=os.environ["SCOPEDPOST_API_KEY"])
result = client.send_email(
from_addr="welcome@your-domain.com",
to=["ada@example.com"],
subject="Welcome",
text="Your first scoped send.",
)
print(result["id"]) # msg_…Samples follow the quickstarts in examples/quickstarts/. The exact client method names are the SDK surface in sdks/typescript/src/ and sdks/python/ — the contract tests keep them honest against the API.
Moving from Resend or Postmark? The migration centre in the dashboard imports your domains, templates and suppressions (up to 10,000 items, idempotent), shows a rollback plan before anything runs, and can roll back. Open the dashboard and choose a team → Migration.
A diagnostic MCP server at POST /api/mcp (JSON-RPC 2.0 over HTTP, scoped-key auth only). Five tools, all read-only diagnostics except one draft creator that never sends:
explain_bounce — why a message bounced or failed, in plain language, with the raw provider response.check_suppression — whether an address is suppressed and why. Returns hashes, never the address.why_spam — why mail from a domain may be landing in spam: spam rate, complaint/bounce rates, and SPF/DKIM/DMARC status.draft_with_approval — create a send draft a human must approve. Routes through the policy engine; never sends.list_agent_activity — an agent's recent sends, receives, approvals and rejections (at most 50 rows; agent keys see only their own).List it in your MCP registry as:
{ "name": "scopedpost", "url": "https://api.scopedpost.com/api/mcp" }With a sk_live_ or sk_test_ key in the Authorization header. Every tools/call is audit-logged with the calling key and agent.
Point Supabase Auth at ScopedPost's SMTP relay instead of Supabase's shared sender: create an SMTP credential in the dashboard (Settings → SMTP credentials), then enable Custom SMTP in Supabase with host smtp.scopedpost.com, port 587, and the credential. SMTP credentials are scoped the same way API keys are — one credential per domain, revocable independently.