tako-sh/tako/tako-sdk-js
Claude Code and agent skill by tako-sh/tako
- community
Checking that the SKILL.md file is still in the repository.
tako.sh SDK: fetch handler interface, tako runtime object, generated tako.d.ts type augmentation, defineChannel/definePresence/defineStore/defineWorkflow, live data and offline reads, Vite and Next.js adapters.
Install
npx vskill@latest install tako-sh/tako/tako-sdk-jsSKILL.md
Tako SDK (tako.sh)
Runtime SDK for JavaScript/TypeScript apps deployed with Tako.
CRITICAL: Thetako.shpackage is required — it provides the entrypoint binaries that tako-server launches to run your app. Tako v0 uses plain ES modules everywhere — noTakoglobal. Runtime state (env, secrets, logger, build info) is accessed through thetakoobject fromtako.sh; channels and workflows are imported from their own files.
CRITICAL: Framework helpers are opt-in. Usetako.sh/vitefor TanStack Start or another Vite build whose server entry exports a fetch handler, andtako.sh/nextjsfor Next.js. Vite alone does not establish framework compatibility. Plain fetch-handler apps do not need either helper. Select the matching guide at https://tako.sh/docs/framework-guides/.
Core Concept: The Fetch Handler
Tako apps export a standard fetch handler as the default export:
The handler signature is:
Two export forms are supported:
Package Exports
| Import path | Purpose | Key exports | |
|---|---|---|---|
tako.sh | Isomorphic runtime + authoring helpers | tako, imageUrl, imageSrcSet, defineChannel, definePresence, defineStore, defineWorkflow, runtime types | |
tako.sh/server | Server-only runtime re-export | tako, TakoRuntime | |
tako.sh/client | Browser-safe realtime clients | Channel, configureChannels, Store, clearStoreCache | |
tako.sh/react | React hooks for realtime data | useChannel, usePresence, useStore | |
tako.sh/vite | Vite plugin for SSR builds | tako() plugin function | |
tako.sh/nextjs | Next.js standalone adapter + wrapper | withTako(), createNextjsAdapter(), createNextjsFetchHandler() | |
tako.sh/runtime | Browser-safe runtime internals | loadSecrets, createLogger, Logger | |
tako.sh/internal | Server-only plumbing for framework-adapter boot | handleTakoEndpoint, initServerRuntime, channel/workflow helpers |
Runtime state: tako.sh + tako.d.ts
tako generate emits a project-local tako.d.ts that augments tako.sh with typed environment names, typed tako.secrets keys, typed tako.storages names, channel metadata, store metadata, workflow metadata, and user-defined env vars on process.env / import.meta.env. Tako-owned runtime values are typed through tako.sh exports such as tako.env, tako.build, and tako.dataDir, not through generated env-var globals. It keeps an existing declaration in app/, src/, or the project root; otherwise it writes to the first existing app/ or src/ directory, falling back to the project root. tako gen and tako g are aliases. When <app_root>/channels/ or <app_root>/workflows/ already exists, it also scaffolds empty definition dirs/files so they default-export defineChannel("<file-stem>") or defineWorkflow(...) stubs. Generated channel stubs use the file stem as the initial name, but tako generate does not rewrite existing explicit names. Generated TakoChannels entries use the declared name as the key and import("tako.sh").InferChannel<typeof import("./channels/<file>").default> for params, messages, and transport metadata. App code imports tako from tako.sh for project runtime state:
Surface
| Export | Description | |
|---|---|---|
tako | Frozen runtime object with env, ports, paths, logger, secrets, storages, and cache | |
tako.env | ENV value ("development", "production", ...) | |
tako.isDev | true when tako.env === "development" | |
tako.isProd | true when tako.env === "production" | |
tako.port | Port assigned to this app instance | |
tako.host | Host/address Tako bound this app instance to | |
tako.build | Build identifier (from TAKO_BUILD) | |
tako.dataDir | Persistent app-owned data directory — writes survive restarts | |
tako.appDir | Directory the app is running from (equivalent to process.cwd()) | |
tako.secrets | Typed secret bag (interface regenerated from .tako/secrets.json) | |
tako.storages | Typed storage bag (interface regenerated from tako.toml) | |
tako.cache | SQLite-backed server-side key/value cache | |
tako.logger | Structured JSON logger (tako.logger.info(...)) | |
Env | TypeScript union of configured environment names | |
TakoSecrets | TypeScript interface of secret names | |
TakoStorages | TypeScript interface of storage names | |
TakoRuntime | TypeScript type of the exported tako object |
Secrets
tako.secrets is a Proxy that:
- Reads from a mutable store populated via fd 3 at startup (before user module is imported)
- Individual access works:
tako.secrets.MY_KEYreturns the string value - Resists bulk serialization:
toString(),toJSON()return"[REDACTED]" - Is typed — the
TakoSecretsinterface augmentation intako.d.tslists every key present in.tako/secrets.json
The generated declaration file is type-only and is not imported by app code. In the browser, use tako.sh/client for realtime clients, or tako.sh/react for hooks.
Cache
Server-side JavaScript can cache JSON-serializable values with explicit get/put/delete calls:
get(key) returns undefined for missing or expired keys. put(key, value, { ttl }) stores a JSON-serializable value; ttl is milliseconds. delete(key) removes one key. Native dev and deploy runtimes store cache entries in Tako-managed local SQLite outside app backups. Container releases do not expose TAKO_DATA_DIR in v0, so the cache helper is unavailable there.
Images
JavaScript can create public optimized image URLs with imageUrl:
The helper returns /_tako/image?src=...&w=... and is synchronous. Explicit URL quality values must also match [images].qualities (default [75]); SDK validation alone does not make a variant server-allowed. Width must be one of 320, 640, 960, 1200, 1920; quality is 1..100; format is webp or avif. Omit format for the optimizer default; Tako defaults to WebP, and format: "avif" is only valid when the app's [images].formats allows AVIF. Local public paths are available by default. Remote URLs must match [images].remote_patterns in tako.toml. Sources may be JPEG, PNG, GIF, WebP, or AVIF; animated GIF and WebP sources keep animation for optimized resize and crop URLs when emitted as WebP. AVIF output is available for still images; animated sources that request AVIF fall back to WebP. The server verifies the app's configured image guardrails before fetching or transforming.
Use imageSrcSet for responsive public images. It returns { src, srcSet, sizes } for an <img> element:
Layouts are constrained (the default), full-width, and fixed. Override widths and sizes for custom responsive markup; each width must be supported by the helper and allowed by the app's image configuration.
Storage
Attach S3-compatible storage with the CLI, then use tako.storages.<name> from server-side app code:
Storage URLs are private by default. S3-compatible bindings use SigV4; local bindings use signed app-local GET/PUT routes under /_tako/storages/<binding>/<key>. createImageUrl(key, { public: true, width }) uses the storage public_base_url and the public image optimizer. createImageSrcSet(key, { public: true, width, layout }) returns responsive public image attributes. Private storage image transforms are not implemented yet; use createDownloadUrl for private direct object URLs.
Vite Plugin
For TanStack Start and other Vite builds with a fetch-compatible server entry:
On `vite build`: Emits <outDir>/tako-entry.mjs — a wrapper that normalizes the compiled server module into a default-exported fetch handler. Point main in tako.toml at this file.
On `vite dev`: Adds .test / .tako.test to allowed hosts and binds to 127.0.0.1. The bound port is reported to tako dev over fd 4.
Next.js Adapter
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/tako-sdk-js/SKILL.md
Popularity
- Repository stars
- 57
- Repository forks
- 2
- 7-day trend score
- 20
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/tako-sh/tako/tako-sdk-js)