From dee8ab37ab66f922f7516cd962cfcff1d8cd7ecc Mon Sep 17 00:00:00 2001 From: Miguel Varela Ramos Date: Thu, 5 May 2022 15:29:15 -0400 Subject: [PATCH 1/2] feat: fetch api token from env variable --- config/config.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config/config.go b/config/config.go index 8cacbbf8..32c404e6 100644 --- a/config/config.go +++ b/config/config.go @@ -5,6 +5,7 @@ import ( "fmt" "io/ioutil" "log" + "os" "time" "github.com/BurntSushi/toml" @@ -145,6 +146,10 @@ func Load(filename string) (*Config, error) { return nil, err } + if envToken := os.Getenv("FULLSTORY_API_TOKEN"); envToken != "" { + conf.FsApiToken = envToken + } + if err := Validate(&conf, time.Now); err != nil { return nil, err } From dea0d4a704637e0f352a4983d48c60f0beb94fc9 Mon Sep 17 00:00:00 2001 From: Miguel Varela Ramos Date: Thu, 12 May 2022 17:34:21 -0400 Subject: [PATCH 2/2] docs: add reference to environment variable in README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index a1a5f5f5..2a1769ca 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,9 @@ SQL recipes for Data Export analysis are in the [Data Export Cookbook](https://g ### Important Configuration Fields +#### `FsApiToken` +Your FullStory API Token. It can also be set through the `FULLSTORY_API_TOKEN` environment variable. + #### `ExportDuration` Determines the time range for each export which ultimately determines the size of each exported file. The size of this file will be based on the amount of traffic that your FullStory account records within the