Skip to content

Commit

Permalink
chore: correct sdk example
Browse files Browse the repository at this point in the history
  • Loading branch information
hazcod committed Sep 1, 2022
1 parent a9748cd commit 9b6ebc8
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,24 @@ package main

import (
intigriti "github.com/intigriti/sdk-go/pkg/api"
"github.com/intigriti/sdk-go/pkg/config"
"log"
)

func main() {
// this will require manual logon every time your code runs
// look into persisting the TokenCache so refresh tokens can be saved
inti, err := intigriti.New("my-client-token", "my-client-secret", nil, nil)
// this will also launch an interactive Browser window to authenticate,
// look at config.OpenBrowser and config.TokenCache to prevent this
inti, err := intigriti.New(config.Config{
Credentials: struct {
ClientID string
ClientSecret string
}{
ClientID: "my-integration-client-id",
ClientSecret: "my-integration-client-secret",
},
})
if err != nil { log.Fatal(err) }
programs, err := inti.GetPrograms()
Expand Down

0 comments on commit 9b6ebc8

Please sign in to comment.