Skip to main content

Feature Flags with a Seat for Everyone

Say goodbye to per-user pricing and hello to feature flags in your IDE.

Go SDK for Prefab

· 2 min read
Jeffrey Chupp

We've released the Go SDK for Prefab. Hooray!

Celebrating gopher

That image is adorable enough1 that I could leave it there and call it a day. But my coworkers insist I talk a little about the SDK.

The Go SDK gives you the Prefab goodness you've come to expect. It is perfect for scenarios where you need to make decisions at runtime based on feature flags or tune your app in production with live config. Whether you're rolling out a new feature gradually, running A/B tests, or managing different settings across environments, the Go SDK has you covered.

I've really enjoyed Go as a language. It has a simple syntax, it's fast, and it's easy to deploy. It feels like an excellent fit for a lot of the work we do at Prefab. We've been using it happily in our Slack Integration and our new Global Delivery service.

If you check out the Go SDK documentation, you'll see that it's straightforward to use. You can install it with go get github.com/prefab-cloud/prefab-cloud-go@latest, set up a client, and then use it to get feature flags and configs.

client, err := prefab.NewClient(prefab.WithAPIKey(apiKey))

if err != nil {
log.Fatalf("error creating prefab client: %v", err)
}

enabled, ok := client.FeatureIsOn("my.feature.name", prefab.ContextSet{})

value, ok, err := client.GetStringValue("some.string.config", prefab.ContextSet{})

We're excited to see what you'll build with the Go SDK. Get started today and let us know how it goes — we'd love to hear your feedback!

Footnotes

  1. I mean, look at that little guy! Thanks to Egon Elbre for the image.

Like what you read? You might want to check out what we're building at Prefab. Feature flags, dynamic config, and dynamic log levels. Free trials and great pricing for all of it.
See our Feature Flags