Why Tako Ships an SDK

Why Tako Ships an SDK

Tako-kun·

Most deploy tools are infrastructure-only. They move your code to a server, maybe configure a reverse proxy, and call it a day. What happens inside your app process is your problem.

We think that’s leaving a lot on the table.

Tako ships SDKs for JavaScript/TypeScript, Go, and Rust because deployment depends on cooperation between infrastructure and application code. Readiness signaling, secret injection, health checks, graceful shutdown, and calls between apps all cross that boundary.

What the SDK Actually Does

The SDK is thin. Your app exports a fetch handler, and the SDK turns it into a running server:

// index.ts — that's it, that's your app
export default function fetch(request: Request): Response {
  return new Response("Hello from Tako");
}

Under the hood, the SDK handles everything between your code and the infrastructure:

ConcernWithout SDKWith Tako SDK
Server bindingYou configure host/port, pick a frameworkSDK binds to an OS-assigned port automatically
Readiness signalInfra polls a TCP port and hopes for the bestApp signals TAKO:READY when actually ready
Health checksYou build a /health endpointBuilt-in /status endpoint with uptime, version, instance ID
Secrets.env files or external secret managersInjected via fd 3 before your code runs, auto-redacted on log
Graceful shutdownYou handle SIGTERM yourselfSDK drains in-flight requests, then exits cleanly
Runtime portabilityLocked to one runtime’s HTTP APISame fetch() signature across Bun and Node

The Readiness Problem

This is the big one. Most deploy tools check health by poking a TCP port — if the socket accepts connections, the app must be ready. But that’s not true. Your server might be listening while still loading config, warming caches, or running migrations.

Tako’s approach is different. The SDK signals readiness explicitly:

Diagram

The new instance writes TAKO:READY:<port> to stdout only after it has read secrets, imported your code, and bound to a port. The server waits for that signal, runs a health probe, and only then adds the instance to the load balancer. No dropped requests, no 502s.

Secrets That Don’t Leak

Secrets deserve special mention. Tako encrypts secrets with AES-256-GCM and stores them in your repo. At deploy time, the server passes them to your app through file descriptor 3 — not environment variables, not files on disk.

The SDK reads fd 3 before importing your code, then exposes secrets through a Proxy that redacts itself. tako generate emits a project-local tako.d.ts that types tako.secrets from tako.sh:

import { tako } from "tako.sh";

tako.secrets.DATABASE_URL; // → "postgres://..."
console.log(tako.secrets); // → "[REDACTED]"
JSON.stringify(tako.secrets); // → "\"[REDACTED]\""

Accidental logging? Handled. Serialization into error reports? Handled.

Same Code, Dev and Prod

One of the quieter benefits: tako dev runs your app through the exact same SDK entrypoint as production. Same fetch handler wrapping, same readiness protocol, same health endpoint. The only differences are the ones you’d expect — local HTTPS on .test instead of your production domain, debug log level by default.

This means if your app starts correctly in dev, it starts correctly in production. No “works on my machine” surprises from a different server setup.

The Real Reason: Built-In Primitives

The same integration gives applications durable work, realtime delivery, and private calls to other apps.

Without an SDK, a deploy tool can only manage processes from the outside — start, stop, route traffic. It has no way to coordinate with your application code. That’s fine for basic deploys, but it’s a dead end for anything more interesting.

The JavaScript SDK exposes these capabilities alongside the HTTP runtime:

  • Background jobs — define a job handler in your code, trigger it from any request, let Tako manage the queue and retries server-side. No external job queue to run.
  • Durable workflows — long-running, resumable workflows where Tako persists state across steps. Your code defines the steps, the SDK handles checkpointing and recovery.
  • Scheduled tasks — cron-like tasks declared in code, executed by the server. Type-safe, version-deployed, no separate cron service.
  • Durable channels — WebSocket/SSE routes for connected browsers, plus bounded replay for reconnects. JavaScript apps keep the file-based shape: channels/ for durable realtime. The SDK handles connection lifecycle, auth, and message typing.
  • Network handlers — one default-exported function per file in network-handlers/, called with call("users.lookup", input). It executes without enqueueing and returns JSON. Workflows and channels also use app.primitive addresses through workflow(...) and channel(...).

Each of these features needs both sides of the equation: server-side infrastructure and application-level integration. A deploy tool without an SDK would need you to bring your own job queue, your own workflow engine, your own scheduler. The SDK is what lets Tako offer these as built-in primitives — type-safe, zero-config, and deployed alongside your app.

Calls stay in the caller’s network and environment. Direct handlers have no automatic retries. Workflow .run(payload) enqueues and waits for a retained result; inside a workflow it checkpoints the child call so the parent can resume after a restart. Channel publication acknowledges publication without waiting for subscribers.

Run tako gen to export the app’s tako-schema.json. A consumer lists producer files or HTTP(S) URLs in root-level schemas in tako.toml and generates its own types. TypeScript gets tako.imports.ts and address registries in tako.d.ts; Go and Rust get native DTOs and constants. Commit tako-schema.lock for reproducible URL imports. Generation does not change package exports.

Go and Rust callers use the same addresses and can import/export schemas, while recipient dispatch and automatic durable child calls currently require JavaScript. See Network Primitives for the language matrix and complete examples.

A Thin Layer, Not a Framework

The SDK integrates with your HTTP framework and database choices. You can use Hono, Elysia, Express, or raw Request/Response. Its primitive folders define discoverable application entry points; they do not replace your application’s router or data layer.

The public API includes the runtime context, workflow and channel definitions, network calls, and typed configuration. A plain fetch handler remains ordinary HTTP code. Applications using durable primitives also depend on their persistence and delivery behavior, so moving those features requires replacing that behavior as well as the imports.

We think the best infrastructure is the kind that knows just enough about your app to do its job well — and nothing more. That’s why Tako ships an SDK.

Check out the docs to get started, or read more about how Tako works under the hood.