Node.js / TypeScript SDK
The official Render25 Node.js client. Works with TypeScript out of the box. Supports ESM and CommonJS.
Node.js 18+TypeScript 5+ESM & CJSBun & Deno
Installation
bash
npm install @render25/sdkOr with yarn / pnpm / bun:
bash
yarn add @render25/sdk
pnpm add @render25/sdk
bun add @render25/sdkBasic Usage
send-email.ts
import { Render25 } from "@render25/sdk";
const client = new Render25({
apiKey: process.env.RENDER25_API_KEY!,
});
const result = await client.email.send({
from: "[email protected]",
to: "[email protected]",
subject: "Welcome!",
html: "<h1>Welcome to the platform.</h1>",
text: "Welcome to the platform.",
tags: ["welcome"],
});
console.log("Sent:", result.id);Note
Set
RENDER25_API_KEY in your environment variables. Never hardcode the key in source code.TypeScript Support
Full types are included — no @types package needed. All request and response payloads are fully typed.
types.ts
import type { EmailSendOptions, EmailSendResult } from "@render25/sdk";
const options: EmailSendOptions = {
from: "[email protected]",
to: "[email protected]",
subject: "Hello",
html: "<p>Hi!</p>",
};
const result: EmailSendResult = await client.email.send(options);Framework Examples
Next.js
Use in API Routes or Server Actions
Express
Use in Express route handlers
app/api/send/route.ts
import { Render25 } from "@render25/sdk";
import { NextResponse } from "next/server";
const client = new Render25({ apiKey: process.env.RENDER25_API_KEY! });
export async function POST(request: Request) {
const { to, subject, html } = await request.json();
const result = await client.email.send({
from: "[email protected]",
to,
subject,
html,
});
return NextResponse.json({ id: result.id });
}