Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add endpoint docs to README #2

Merged
merged 2 commits into from
Nov 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,36 @@ func main() {
client.Close()
}
```

## Other Regions

If you're using a [different data center](https://customer.io/docs/accounts-and-workspaces/data-centers/) such as our EU region, you can specify an alternate endpoint:

```go
package main

import (
"os"

"github.com/customerio/cdp-analytics-go"
)

func main() {
client, err := analytics.NewWithConfig(os.Getenv("WRITE_KEY"), analytics.Config{
Endpoint: "https://cdp-eu.customer.io",
})
if err != nil {
panic(err)
}

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to close the connection here i.e. client.Close()?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a ... to indicate that this is just an example. The first example at the top of the README already includes it.

// ...
}
```

## Documentation

The links below contain more detailed documentation on how to use this library:

* [Documentation](https://customer.io/docs/cdp/sources/connections/servers/go/)
* [Specs](https://customer.io/docs/cdp/sources/source-spec/source-events/)
* [godoc](https://pkg.go.dev/github.com/customerio/cdp-analytics-go)
Loading