Go feature flags installation

Terminal
go get github.com/posthog/posthog-go
Go
package main
import (
"os"
"github.com/posthog/posthog-go"
)
func main() {
client, _ := posthog.NewWithConfig(
os.Getenv("POSTHOG_API_KEY"),
posthog.Config{
PersonalApiKey: "your personal API key", // Optional, but much more performant. If this token is not supplied, then fetching feature flag values will be slower.
Endpoint: "https://us.i.posthog.com",
},
)
defer client.Close()
// run commands
}

Next steps

ResourceDescription
Adding feature flag codeHow to check flags in your code for all platforms
Framework-specific guidesSetup guides for React Native, Next.js, Flutter, and other frameworks
How to do a phased rolloutGradually roll out features to minimize risk
More tutorialsOther real-world examples and use cases

Community questions

Was this page useful?

Questions about this page? or post a community question.