FEATUREFLOW V2AI-native · MCP-enabled ·30% off your first year:NEXT30claim →

server SDK

Go feature flags

The Go SDK evaluates rules in-process. It needs Go 1.21 or later and a server key from the environment. Client returns (*FeatureflowClient, error). Do not discard the error: an empty key returns a nil client.

Go docsGitHubgithub.com/featureflow/featureflow-go-sdk

Set it up with your coding agent

Paste this into Claude Code, Cursor or any coding agent. It installs the Go SDK, creates the client and evaluates your first flag.

Set up Featureflow with the Go SDK in this project. Run `npx skills add featureflow/featureflow-skills --skill featureflow-setup -y` first, then follow the skill. Keep SDK keys in env vars.

Or set it up by hand

Install

go get
go get github.com/featureflow/featureflow-go-sdk
import
import "github.com/featureflow/featureflow-go-sdk/featureflow"

Initialise

Client
client, err := featureflow.Client(os.Getenv("FEATUREFLOW_SERVER_KEY"), featureflow.Config{})
if err != nil {
    log.Fatalf("featureflow: %v", err)
}

Evaluate a flag

Evaluate
user, err := featureflow.NewUserBuilder("user-123").
    WithAttribute("tier", "gold").
    Build()
if err != nil {
    log.Fatal(err)
}

if client.Evaluate("new-checkout", user).IsOn() {
    // the new checkout
}

Kill switch

A feature with no registration and no configuration evaluates to off. Register a failover with WithFeature(key, variant) when off is the harmful answer. The docs say a kill switch's safe failover is usually on. Create one client in main and pass it down.

The operational side is the kill switch. Turning the flag off does not require a redeploy.

Gradual rollout

The docs say percentage rollouts hash the feature key and the user id with SHA-1. Use a stable account id. A per-request UUID turns a user rollout into a request rollout. EvaluateBasic(key, userId) builds a user when you have no attributes. Goal tracking and JSON config values are not in this SDK.

See progressive rollout for the dashboard control. Release pipelines and approval workflows, if the change itself needs a review, are on the Business plan at $399 a month. That price is on the pricing page.

Targeting

WithAttribute sets one value. WithAttributes sets a list, and a rule matches if any element matches. NewUserBuilder adds featureflow.user.id and featureflow.date. Build the user per request, or featureflow.date is frozen at process start. Build errors when the id is empty.

Frequently asked questions

How do I install the Go SDK?

go get github.com/featureflow/featureflow-go-sdk and import github.com/featureflow/featureflow-go-sdk/featureflow. The docs require Go 1.21 or later.

What does Client return?

(*FeatureflowClient, error). An empty API key returns a nil client and an error. A wrong key still constructs a client, and flags fall back to their failover variant while the poll fails.

Does Go support track()?

No. The Go SDK docs say there is no track method, and the compatibility table lists goal tracking and JSON configuration values as not yet supported.

Other SDKs

Create the flag, then evaluate it

Every SDK is on the free plan. No credit card.