Last updated 2026-08-26

Generated SDKs

Type-safe runtime bindings for Go and TypeScript generated directly from topology contracts.


Generated SDKs

Fluffy eliminates runtime environment variable parsing and broken connection strings by compiling capability bindings into type-safe SDK packages.


#Overview

When you run fluffy-chainsaw generate, Fluffy inspects the resolved topology and generates runtime clients directly into your application's source tree under .fluffy/.

Pro Tip
The SDK contains zero handwritten boilerplate. Everything is typed and matches your exact declared permissions.

#Go Runtime Bindings

In Go runtimes, import the generated client to interact with your databases, topics, and secrets:

go
1package main
2
3import (
4 "context"
5 "log"
6 "my-project/.fluffy/sdk/database"
7 "my-project/.fluffy/sdk/topic"
8)
9
10func main() {
11 ctx := context.Background()
12
13 // Fully typed database connection pool
14 db, err := database.GetPrimaryMainDb(ctx)
15 if err != nil {
16 log.Fatalf("failed to connect: %v", err)
17 }
18
19 // Publish typed events
20 ordersTopic, err := topic.GetOrdersTopic(ctx)
21 ordersTopic.Publish(ctx, []byte("order-payload"))
22}

#TypeScript Browser SDK

For web entrypoints and portals:

typescript
1import { createFluffyClient } from '~/generated/fluffy-client'
2
3const client = createFluffyClient({
4 endpoint: process.env.VITE_API_ENDPOINT,
5})
6
7// Type-safe RPC with automatic token injection
8const result = await client.orders.create({
9 sku: 'FLUFFY-CORE-01',
10 quantity: 2,
11})

#Drift Detection in CI

Prevent untested code or mismatched capability requirements from reaching production:

sh
1fluffy-chainsaw generate --application storefront --check

If a developer changed a database permission or added a secret without regenerating code, the check command exits with a non-zero status code.