Skip to content

SDKs

Twilic has production-ready implementations in eighteen languages. The current specification family is v3. Rust, Go, JavaScript, and Zig ship v3 by default; other SDKs remain on the v2 interop line until their v3 support lands. All SDKs share a consistent API surface.

Documentation

ResourceDescription
API ReferenceComplete function signatures for JS, Rust, Python, Go
IntegrationsHTTP packages for Hono, Express, Fastify, Fetch, Axios
Encoding ProfilesDynamic, Batch, Bound, Stateful
Quick StartInstall and first encode in every language

Available SDKs

LanguagePackageWire lineRequirements
Rusttwilic (crates.io)v3Rust stable (edition 2024)
Gogithub.com/twilic/twilic-gov3Go 1.22+
JavaScript / TypeScript@twilic/corev3Node.js 24+ / WASM
Zigtwilic (build.zig.zon)v3Zig 0.16.0+
Pythontwilic (PyPI)v2Python 3.12+
Javaio.twilicv2Java 21+
Scalaio.twilic (GitHub)v2Java 21+ / Scala 3.3+
Rubytwilic (RubyGems)v2Ruby 3.3+
Rtwilic (GitHub)v2R 4.4+
PHPtwilic/twilic (GitHub)v2PHP 8.3+
Kotlinio.twilic:twilic (GitHub)v2JDK 21+
Darttwilic (GitHub)v2Dart SDK 3.5+
Elixir:twilic (GitHub)v2Elixir 1.19+ / OTP 27+
Luatwilic (GitHub / LuaRocks)v2Lua 5.4
Ctwilic-c (GitHub)v2CMake 3.16+ / C11
C++twilic-cpp (GitHub)v2CMake 3.16+ / C++17
C#Twilic (GitHub)v2.NET 8 SDK
SwiftTwilic (SPM)v2Swift 5.9+

Common API Surface

All SDKs expose the same logical operations:

OperationDescriptionReference
encode(value)Dynamic profile encodeProfiles
decode(bytes)Decode to valueErrors & Limits
encode_with_schema(value, schema)Bound profile encodeSchema-Bound
encode_batch(records)Same-shape batchBatch & Columnar
SessionEncoderStateful stream encoderSession Encoder

JavaScript entrypoints

ImportUse
@twilic/coreinit, encode, decode, createSessionEncoder
@twilic/core/advancedencodeBatch, encodeBoundStream, encodeBatchWithSchema, transport-JSON

See JavaScript Core API and Advanced API.

Rust (Reference Implementation)

The JavaScript SDK is built on the Rust implementation via N-API and WASM. Full low-level API: Rust reference.

Interoperability

v3 SDKs (Rust, Go, JavaScript, Zig) interoperate on the v3 reference profile, including BOUND_STREAM and SCHEMA_BATCH. v2 SDKs interoperate on the v2 fixture line. Mix v2 and v3 only when both sides agree on version and profile. See Interop guide.

Released under the CC-BY-4.0 License.