https://github.com/buddy/api-go-sdk
SDK for Buddy rest api written in GO
https://github.com/buddy/api-go-sdk
Last synced: 3 months ago
JSON representation
SDK for Buddy rest api written in GO
- Host: GitHub
- URL: https://github.com/buddy/api-go-sdk
- Owner: buddy
- License: mpl-2.0
- Created: 2022-04-04T10:22:28.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-12-17T07:12:27.000Z (6 months ago)
- Last Synced: 2025-12-20T04:50:05.064Z (6 months ago)
- Language: Go
- Size: 430 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Buddy SDK for Go
`api-go-sdk` is the Buddy SDK for the Go programming language.
The SDK requires a minimum version of `Go 1.23`.
Checkout out [our blog](https://buddy.works/blog) for information about the latest changes
## Getting started
To get started working with the SDK setup your project for Go modules, and retrieve the SDK dependencies with `go get`.
This example shows how you can use the SDK to make an API request using the SDK's client.
###### Initialize Project
```sh
$ mkdir ~/buddytest
$ cd ~/buddytest
$ go mod init buddytest
```
###### Add SDK Dependencies
```sh
$ go get github.com/buddy/api-go-sdk
```
###### Write Code
In your preferred editor add the following content to `main.go`
```go
package main
import (
"fmt"
"github.com/buddy/api-go-sdk/buddy"
"os"
)
func main() {
client, err := buddy.NewDefaultClient(os.Getenv("BUDDY_TOKEN"))
if err != nil {
fmt.Printf("Error: %s", err.Error())
os.Exit(1)
}
profile, _, err := client.ProfileService.Get()
if err != nil {
fmt.Printf("Error: %s", err.Error())
os.Exit(1)
} else {
fmt.Printf("My name is %s", profile.Name)
}
}
```
## Examples
For more examples go to [examples directory](https://github.com/buddy/api-go-sdk/tree/main/examples)
## API docs
Full API docs can be found [here](https://buddy.works/docs/api)