Skip to main content

Go Server SDK

The FlagTGL Go Server SDK is designed for backend services running in Go. It connects to the FlagTGL relay proxy or API to evaluate feature flags server-side.

Installation

go get github.com/flagtgl/go-server-sdk

Quick Start

client := flagtgl.NewClient("your-sdk-key")
defer client.Close()

user := flagtgl.NewUser("user-123").WithAttribute("plan", "pro")
enabled := client.BoolVariation("my-flag", user, false)

The SDK is compatible with the LaunchDarkly Go SDK interface, making migration straightforward. See the Migration Guide for details.

Safe behavior when FlagTGL is unavailable

Every evaluation includes a fallback value. If FlagTGL is unreachable and no last-known-good configuration is available, the SDK serves that code-defined fallback. Passing false means Disabled for all contexts:

enabled := client.BoolVariation("new-rbac", user, false)

Keep fallbacks conservative, explicit, and covered by application tests.

note

Full SDK reference documentation is coming soon.