From 9b6ebc8d451a0bf60043bc6536b1aaeb15c42950 Mon Sep 17 00:00:00 2001 From: Niels H Date: Thu, 1 Sep 2022 10:34:11 +0200 Subject: [PATCH] chore: correct sdk example --- README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a18bb40..ddb5ee7 100644 --- a/README.md +++ b/README.md @@ -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()