https://github.com/GetStream/stream-chat-go
Stream Chat official Golang API Client
https://github.com/GetStream/stream-chat-go
chat chat-api go golang rest
Last synced: 3 days ago
JSON representation
Stream Chat official Golang API Client
- Host: GitHub
- URL: https://github.com/GetStream/stream-chat-go
- Owner: GetStream
- License: bsd-3-clause
- Created: 2019-07-30T07:34:56.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2026-01-20T10:30:34.000Z (6 days ago)
- Last Synced: 2026-01-20T19:41:42.560Z (6 days ago)
- Topics: chat, chat-api, go, golang, rest
- Language: Go
- Homepage: https://getstream.io/chat/
- Size: 719 KB
- Stars: 75
- Watchers: 29
- Forks: 33
- Open Issues: 25
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
- awesome-stream - GitHub: stream-chat-go
README
# Official Go SDK for [Stream Chat](https://getstream.io/chat/)
[](https://github.com/GetStream/stream-chat-go/actions)
[](https://pkg.go.dev/github.com/GetStream/stream-chat-go/v8?tab=doc)
Official Go API client for Stream Chat, a service for building chat applications.
Explore the docs ยป
Report Bug
ยท
Request Feature
## ๐ About Stream
You can sign up for a Stream account at our [Get Started](https://getstream.io/chat/get_started/) page.
You can use this library to access chat API endpoints server-side.
For the client-side integrations (web and mobile) have a look at the JavaScript, iOS and Android SDK libraries ([docs](https://getstream.io/chat/)).
## โ๏ธ Installation
```shell
go get github.com/GetStream/stream-chat-go/v8
```
## โจ Getting started
```go
package main
import (
"os"
stream "github.com/GetStream/stream-chat-go/v8"
)
var APIKey = os.Getenv("STREAM_KEY")
var APISecret = os.Getenv("STREAM_SECRET")
var userID = "" // your server user id
func main() {
// Initialize client
client, err := stream.NewClient(APIKey, APISecret)
// Or with a specific timeout
client, err := stream.NewClient(APIKey, APISecret, WithTimeout(3 * time.Second))
// Or using only environmental variables: (required) STREAM_KEY, (required) STREAM_SECRET,
// (optional) STREAM_CHAT_TIMEOUT
client, err := stream.NewClientFromEnvVars()
// handle error
// Define a context
ctx := context.Background()
// use client methods
// create channel with users
users := []string{"id1", "id2", "id3"}
userID := "id1"
channel, err := client.CreateChannelWithMembers(ctx, "messaging", "channel-id", userID, users...)
// use channel methods
msg, err := channel.SendMessage(ctx, &stream.Message{Text: "hello"}, userID)
}
```
## โ๏ธ Contributing
We welcome code changes that improve this library or fix a problem, please make sure to follow all best practices and add tests if applicable before submitting a Pull Request on Github. We are very happy to merge your code in the official repository. Make sure to sign our [Contributor License Agreement (CLA)](https://docs.google.com/forms/d/e/1FAIpQLScFKsKkAJI7mhCr7K9rEIOpqIDThrWxuvxnwUq2XkHyG154vQ/viewform) first. See our [license file](./LICENSE) for more details.
Head over to [CONTRIBUTING.md](./CONTRIBUTING.md) for some development tips.
## ๐งโ๐ป We are hiring!
We've recently closed a [$38 million Series B funding round](https://techcrunch.com/2021/03/04/stream-raises-38m-as-its-chat-and-activity-feed-apis-power-communications-for-1b-users/) and we keep actively growing.
Our APIs are used by more than a billion end-users, and you'll have a chance to make a huge impact on the product within a team of the strongest engineers all over the world.
Check out our current openings and apply via [Stream's website](https://getstream.io/team/#jobs).