// HTTP handlers with automatic validation (headers + body)
api.RegisterUserServiceServer(userService, api.WithMux(mux))
// Type-safe HTTP client with functional options
client := api.NewUserServiceClient("http://localhost:8080",
api.WithUserServiceAPIKey("your-api-key"),
)
user, err := client.CreateUser(ctx, req)
// Mock server with realistic data
mockService := api.NewMockUserServiceServer()
api.RegisterUserServiceServer(mockService, api.WithMux(mux))
TypeScript β clients and servers:
// HTTP client with full type safety
const client = new UserServiceClient("http://localhost:8080", {
apiKey: "your-api-key",
});
const user = await client.createUser({ name: "John", email: "john@example.com" });
// HTTP server (framework-agnostic, Web Fetch API)
const routes = createUserServiceRoutes(handler);
// Wire into any framework: Bun.serve, Deno.serve, Express, Hono, etc.
OpenAPI β validation rules, headers, and examples included automatically:
UserService.openapi.yaml
Quick setup
# Install the tools
go install github.com/SebastienMelki/sebuf/cmd/protoc-gen-go-http@latest
go install github.com/SebastienMelki/sebuf/cmd/protoc-gen-go-client@latest
go install github.com/SebastienMelki/sebuf/cmd/protoc-gen-openapiv3@latest
go install github.com/SebastienMelki/sebuf/cmd/protoc-gen-ts-client@latest
go install github.com/SebastienMelki/sebuf/cmd/protoc-gen-ts-server@latest
# Try the complete example
cd examples/simple-api && make demo
Real-time global intelligence dashboard tracking seismology, cyber threats, markets, aviation, and more. Full-stack TypeScript with sebuf β generated TS clients, TS server handlers, and OpenAPI docs all from the same proto definitions. Actively battle-testing sebuf across every generator. See the integration PR.
Type-safe Go SDK for the Alpaca Trading API β 100+ endpoints across trading, market data, brokerage, and auth, all generated from protobuf definitions. The entire Alpaca REST API modeled as proto files with sebuf annotations. Clients, validation, and OpenAPI docs that can never drift from the actual API.
sebuf powers API services at Anghami, the leading music streaming platform in the Middle East and North Africa, and at OSN+, the region's premium streaming service featuring HBO, Paramount+, and OSN Originals.
sebuf is used at Sarwa, the fastest-growing investment and personal finance platform in the MENA region, powering type-safe API contracts across their trading, investing, and savings services.