TypeScript SDK

A modern, holistic, distributed application development framework

for folks who love TypeScript.

TypeScript
TypeScript Icon
null Icon
Resonate
Resonate Icon
null Icon
Unstoppable
Unstoppable Icon

Install the SDK.

npm install @resonatehq/sdk

Install and run the Server.

brew install resonatehq/tap/resonate

Write code.

// app-node.ts
import express, { Request, Response } from "express";
import { Resonate, Context } from "@resonatehq/sdk";
  
// Initialize Resonate Scheduler
const resonate = new Resonate();
  
// Define your workflow
export async function downloadAndSummarize(ctx: Context, url: string) {
    const content = await ctx.run(download, url);
    conar summary = await ctx.run(summarize, content);
    return summary;
}

async function download(ctx: Context, url: string): string {
    return "This is the content";
}

async function summarize(ctx: Context, content: string): string {
    return "This is the summary";
}

resonate.register(
    "downloadAndSummarize",
    downloadAndSummarize,
);

// Start the Resonate application
resonate.start();

// Define a route handler for the /summarize endpoint
app.post("/summarize", async (req: Request, res: Response) => {
    const url = req.body?.url;
    try {
        // Call the resonate function
        let summary = await resonate.run(
            "downloadAndSummarize",
            "summarize-" + url,
            url
        );
        res.send(summary);
    } catch (e) {
        res.status(500).send("An error occurred.");
    }
});

app.listen(3000, () => {
    console.log("Listening on port 3000");
});

Continue building an AI summarization agent with the quickstart tutorial.

The joy of TypeScript meets

cloud-scale power.

The TypeScript developer’s toolkit for resilient cloud systems.

Your vision, our framework—together, unstoppable.