SDKsPlatform
Go SDK (platform)
Install and use the Ours Privacy Go platform SDK to manage sources, destinations, consent settings, and more from your Go applications.
Go Platform SDK
The Ours Privacy Go platform SDK gives you programmatic access to manage your account configuration — sources, destinations, consent settings, and more.
Installation
import (
"github.com/with-ours/platform-sdk-go" // imported as githubcomwithoursplatformsdkgo
)Or to pin the version:
go get -u 'github.com/with-ours/platform-sdk-go@v1.0.0'Usage
package main
import (
"context"
"fmt"
"github.com/with-ours/platform-sdk-go"
"github.com/with-ours/platform-sdk-go/option"
)
func main() {
client := githubcomwithoursplatformsdkgo.NewClient(
option.WithAPIKey("My API Key"), // defaults to os.LookupEnv("OURS_PRIVACY_API_KEY")
)
sources, err := client.Sources.List(context.TODO())
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", sources.Data)
}Resources
- Platform API Docs — authentication, quickstart, and full API documentation
- Platform OpenAPI Schema — the full specification for the platform API
- pkg.go.dev
- GitHub repository
How is this guide?