Skip to main content
Version: v1.30.0


The GitHub Retriever will perform an HTTP Request with your GitHub configuration to get your flags.


GitHub has rate limits, be sure to correctly set your PollingInterval to avoid reaching the limit.

If the rate limit is reached, the retriever will return an error and will stop polling until GitHub allows it again.


err := ffclient.Init(ffclient.Config{
PollingInterval: 3 * time.Second,
Retriever: &githubretriever.Retriever{
RepositorySlug: "thomaspoignant/go-feature-flag",
Branch: "main",
FilePath: "testdata/flag-config.goff.yaml",
GithubToken: "XXXX",
Timeout: 2 * time.Second,
defer ffclient.Close()

Configuration fields

To configure the access to your GitHub file:

RepositorySlugYour GitHub slug org/repo-name.
FilePathThe path of your file.
The branch where your file is.
Default: main
Github token is used to access a private repository, you need the repo permission (how to create a GitHub token).
Timeout for the HTTP call
Default: 10 seconds

Get the latest GO Feature Flag updates