Hightouch Events SDK for Go.
The package can be installed via go get
, we recommend that you use a
package version management system like the Go vendor directory or a tool like
Godep to avoid issues related to API breaking changes introduced between major
versions of the library.
To install it in the GOPATH:
go get github.com/ht-sdks/events-sdk-go
The links bellow should provide all the documentation needed to make the best use of the library and the Hightouch Events API:
package main
import (
"github.com/ht-sdks/events-sdk-go"
)
func main() {
// Instantiates client to send events to the Hightouch Events API.
client, _ := htevents.NewWithConfig("WRITE_KEY", htevents.Config{
Endpoint: "https://us-east-1.hightouch-events.com",
})
// Flushes any queued messages and closes the client.
defer client.Close()
// Enqueues a track event that will be sent asynchronously.
client.Enqueue(htevents.Track{
Event: "Created Account",
UserId: "123",
Properties: htevents.Properties{
"application": "Desktop",
"version": "1.2.3",
"platform": "osx",
},
})
}
The library is released under the MIT license.