8000 feat: fetch api token from env variable by miguelvr · Pull Request #115 · fullstorydev/hauser · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: fetch api token from env variable #115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments. Retry
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"io/ioutil"
"log"
"os"
"time"

"github.com/BurntSushi/toml"
Expand Down Expand Up @@ -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
}
Expand Down
0