Skip to content
Reeltopus

SDKs

The official TypeScript and Python SDKs for the Reeltopus API: typed models, multipart uploads, wait helpers, retries with idempotency keys and webhook verification.

Both SDKs are generated from the OpenAPI document and tested against a mock of it, so every endpoint has a typed method. Both are MIT licensed.

TypeScript and JavaScript

npm install @reeltopus/sdk

ESM, no runtime dependencies, Node 20+, Deno, Bun, Cloudflare Workers and Vercel Edge.

import { Reeltopus } from "@reeltopus/sdk";

const reeltopus = new Reeltopus(); // reads REELTOPUS_API_KEY

const project = await reeltopus.uploads.uploadFile("./episode-12.mp4");
await reeltopus.projects.waitUntilReady(project.id);

const { data: clips } = await reeltopus.projects.clips(project.id);
const exported = await reeltopus.clips.exportAndWait(clips[0].id, { resolution: "1080p" });
console.log(exported.files.mp4?.url);

Python

pip install reeltopus

Python 3.9+, on httpx. Reeltopus for sync code and AsyncReeltopus for asyncio, with the same methods. Every request and response is a typed dict, and the package ships py.typed.

from reeltopus import Reeltopus

client = Reeltopus()  # reads REELTOPUS_API_KEY

project = client.uploads.upload_file("episode-12.mp4")
client.projects.wait_until_ready(project["id"])

clips = client.projects.clips(project["id"])["data"]
exported = client.clips.export_and_wait(clips[0]["id"], {"resolution": "1080p"})
print(exported["files"]["mp4"]["url"])

What the SDKs do for you

Verifying webhooks

import { verifyWebhook } from "@reeltopus/sdk/webhooks";

export async function POST(request: Request) {
  const event = await verifyWebhook(process.env.REELTOPUS_WEBHOOK_SECRET!, request.headers, await request.text());
  if (event.type === "clip.exported") console.log(event.data.export.files.mp4?.url);
  return new Response(null, { status: 204 });
}
from reeltopus.webhooks import verify_webhook

event = verify_webhook(os.environ["REELTOPUS_WEBHOOK_SECRET"], request.headers, request.get_data())
if event["type"] == "clip.exported":
    print(event["data"]["export"]["files"]["mp4"]["url"])

Pass the raw body, before JSON parsing. Deliveries older than 5 minutes are refused, and event ids stay the same on retries, so use them to de-duplicate.

Other languages

The OpenAPI 3.1 document works with openapi-generator, Speakeasy, Stainless and Postman. Webhooks follow Standard Webhooks, which has verification libraries for Go, Ruby, PHP, Java, Rust, C# and more.