API Reference
Complete API documentation for Twilic SDKs, integration packages, and tooling. Use this section when you need exact function signatures, types, and options — not just conceptual overviews.
Packages
JavaScript / TypeScript
| Package | Description |
|---|---|
@twilic/core | Main entry: init, encode, decode, createSessionEncoder |
@twilic/core/advanced | Batch, schema, transport-JSON, direct encoding, AdvancedSessionEncoder |
Web integrations
| Package | Description |
|---|---|
| Overview | All HTTP client and server packages |
@twilic/hono | Hono middleware and response helpers |
@twilic/fetch | fetch wrapper and response parsing |
@twilic/express | Express middleware |
@twilic/fastify | Fastify plugin and reply decorator |
@twilic/axios | Axios instance with interceptors |
Native SDKs
| Language | Reference |
|---|---|
| Rust | twilic-rust — reference implementation |
| Python | twilic-python |
| Go | twilic-go |
| Java | twilic-java |
| C | twilic-c |
Other language SDKs follow the same four-function surface (encode, decode, encode_batch, create_session_encoder). See SDKs overview for install instructions per language.
Shared concepts
| Topic | Page |
|---|---|
| Value types and Schema | Value & Schema |
| SessionEncoder and options | Session Encoder |
| Errors and decode limits | Errors & Limits |
Choosing an entrypoint
text
One-shot encode/decode?
→ encode() / decode() from @twilic/core (or language equivalent)
Batch of same-shape records?
→ encodeBatch() from @twilic/core/advanced
→ encode_batch() in Rust / Python / Go
Schema-aware (Bound profile)?
→ encodeWithSchema() from @twilic/core/advanced
Long-lived stream with incremental updates?
→ createSessionEncoder() + encodePatch()
HTTP API?
→ Integration package + stateless Dynamic or Batch only
Debugging wire bytes?
→ Twilic CLI decode, or decodeToTransportJson() (advanced)Related
- Encoding Profiles — when to use Dynamic, Batch, Bound, Stateful
- Cookbook — practical patterns
- Specification — normative wire format