Zig SDK
The transit_sdk package exports the shared Zig caller modules for consumer
applications. It preserves their existing import names and exact type identity;
protocol and framework implementation remains in packages/zig/.
Installation
Use the repository's pinned Zig compiler and a matching
Transit checkout. Add a path dependency on its sdks/zig directory in your
application's build.zig.zon:
.dependencies = .{
.transit_sdk = .{ .path = "../transit/sdks/zig" },
},
The complete checkout supplies the shared dependency closure. Copying only
sdks/zig is insufficient; an independently distributed Zig archive is not
provided. Select the same protocol definition as the running authority.
In build.zig, resolve the SDK once and import only the modules your application
uses, with your own target and optimization settings:
const sdk = b.dependency("transit_sdk", .{ .target = target, .optimize = optimize });
app.root_module.addImport("transit_client", sdk.module("transit_client"));
app.root_module.addImport("transit_station", sdk.module("transit_station"));
Existing @import("transit_client") and @import("transit_station") statements
remain unchanged. Allocators, I/O, credentials, resident bounds and handle
lifetimes stay explicit in the owning APIs.
Exported modules
| Module | API owner |
|---|---|
transit_client | Signed operations, scoped sessions and exact recovery |
transit_protocol | Public values and canonical contracts |
transit_station | Behaviors, turns and state helpers |
transit_station_document | Document callers |
transit_station_http | Recorded HTTP callers |
transit_station_grpc | Recorded RPC callers |
transit_query | Query preparation, admission and reads |
transit_catalog | Catalog declarations and callers |
transit_fuze | Typed query plans and execution |
transit_station_app | Application declarations and installation |
The work-items application has a standalone manifest consuming this SDK. The root example builds use the same SDK modules. The caller reference defines uncertainty, current authorization and cancellation across all supported languages.