ship deploys and declares the bindings the runtime resolves onto env. There are two forms:
func.toml(classic) — one function. Written bytelnyx-edge new-func; can declare[env_vars],[telnyx],[[secrets]], and[storage.kv.<NAME>].telnyx.toml(umbrella) — a TypeScript project with a top-levelmainentry, bundled client-side onship. Declares the same binding blocks plus[[actors]], which classic projects cannot.
telnyx-edge types reads either form and writes telnyx-env.d.ts, typing env.<binding> for each declaration.
func.toml
new-func writes the minimal manifest — and because it registers the function server-side at scaffold time, the UUID func_id is already in it:
language key (the runtime comes from the project files the scaffold creates), no build block, and no timeout key — the request timeout is a platform property (default 30 s, maximum 60 s; see Limits).
[edge_compute]
| Key | Value |
|---|---|
func_id | The function’s UUID, written by new-func when it registers the function server-side. This — not the directory — is what ship deploys, so swapping func.toml files switches deploy targets (the CI/CD staging pattern relies on this). |
func_name | The function name. Determines the URL: https://{func_name}-{org-nickname}.telnyxcompute.com — see Routes & Domains. |
[env_vars]
Free-form key-value pairs injected as process environment variables on each deploy. All values are strings; changes take effect on the nextship; values are plaintext in git — put credentials in secrets instead. See Environment Variables.
[telnyx]
| Key | Value |
|---|---|
binding | The property on env — env.<binding> is a pre-authenticated Telnyx SDK client in TypeScript functions. |
TELNYX_API_KEY environment variable into the container — this is how non-TypeScript runtimes call the Telnyx API over plain REST. See Telnyx API binding.
[[secrets]]
| Key | Value |
|---|---|
binding | The handle your code passes to env.SECRETS.get(). |
name | The stored secret key, from telnyx-edge secrets add <key> <value>. |
[storage.kv.<NAME>]
| Key | Value |
|---|---|
block key <NAME> | The handle — a name you choose. env.<NAME> is a KvNamespace (get/put/delete/list). |
id | The KV namespace UUID, from telnyx-edge storage kv create. |
env property. telnyx-edge types generates KvNamespace types for these blocks since CLI v0.2.3. See the KV quick start.
telnyx.toml
The umbrella manifest replaces[edge_compute] with top-level keys and adds [[actors]]. On ship, the module graph rooted at main is bundled into a single file with esbuild (TypeScript/JavaScript only) and the manifest ships with it.
| Key | Value |
|---|---|
name | Function name, used by the platform to register the function. |
main | Entry module — the root of the client-side esbuild bundle. |
compatibility_date | Runtime compatibility pin. |
[[actors]] | Actor bindings — binding is the env property, type the class to instantiate per name. Ship-time constraints (identifier rules, uniqueness, the 32-character type cap) are specified in the Stateful Actors configuration reference. |
fetch handler — is covered in Project Structure. telnyx-edge new-func --actor scaffolds it.
Ship-time validation
Binding handles and[env_vars] names share one env namespace, and ship rejects manifests that break it:
- An
[env_vars]entry with the same name as a declared binding fails validation. SECRETSis reserved whenever a[[secrets]]block is declared — no other binding or[env_vars]entry may use it.- Duplicate
[[secrets]]bindings with the same handle are rejected.
Related
- CLI reference —
new-funcwrites the manifest;shipandtypesread it - Bindings — the declare →
types→envpattern behind every block - Environment variables — everything that lands in the container’s environment
- Secrets — both access surfaces for
[[secrets]] - Stateful Actors configuration — the
[[actors]]block in full