Skip to content

SDKs

Go SDK

Send server-side events, evaluate feature flags locally and capture errors from Go.

Install

Terminal
go get github.com/tracklyne/tracklyne-go
main.go
client, _ := tracklyne.New("tl_your_project_token", tracklyne.Config{
  Host:           "https://tracklyne.com",
  PersonalAPIKey: os.Getenv("TL_PERSONAL_KEY"), // local flag evaluation
})
defer client.Close() // sends what is still queued

client.Capture(tracklyne.Capture{DistinctID: user.ID, Event: "invoice paid"})

Feature flags and errors

main.go
on, _ := client.IsFeatureEnabled("new-billing", user.ID)

if err := work(); err != nil {
  client.CaptureException(err, user.ID, nil)
}

Go 1.22+, standard library only. Wrapped errors are sent with their causes.