Skip to content
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

fix(demo): Updated the to the latest version of the sdk and broke out the client secret to be retrieved from the env #72

Merged
merged 2 commits into from
Feb 10, 2025
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion demo/GoDemoApp.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@ func main() {
h := slog.NewJSONHandler(os.Stdout, &slog.HandlerOptions{Level: programLevel})
slog.SetDefault(slog.New(h))

confidence := c.NewConfidenceBuilder().SetAPIConfig(*c.NewAPIConfig("CLIENT_SECRET")).Build()
// Read the client secret from env
clientkey := os.Getenv("CONFIDENCE_GO_CLIENT")
if clientkey == "" {
fmt.Println("No client key defined")
os.Exit(1)
}

confidence := c.NewConfidenceBuilder().SetAPIConfig(*c.NewAPIConfig(clientkey)).Build()
confidence.PutContext("targeting_key", "Random_targeting_key")
withAddedContext := confidence.WithContext(map[string]interface{}{
"Something": 343,
Expand Down
2 changes: 1 addition & 1 deletion demo/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module demo

go 1.22.2

require github.com/spotify/confidence-sdk-go v0.2.3
require github.com/spotify/confidence-sdk-go v0.4.1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line doesn't really matter (I think) since it will be replaced by the declaration on line 9.


require golang.org/x/exp v0.0.0-20240213143201-ec583247a57a // indirect

Expand Down