Skip to content

GetStream/stream-chat-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

a119859 · Dec 14, 2020
Sep 24, 2020
Oct 28, 2019
Apr 6, 2020
Sep 17, 2020
Dec 14, 2020
Aug 20, 2020
Jul 30, 2019
Sep 24, 2020
Jun 25, 2020
Sep 24, 2020
Dec 14, 2020
Jun 25, 2020
Oct 12, 2020
Sep 24, 2020
Jun 23, 2020
Sep 24, 2020
Sep 24, 2020
Sep 24, 2020
Sep 24, 2020
Jun 25, 2020
Sep 24, 2020
Sep 17, 2020
Mar 10, 2020
Sep 24, 2020
Sep 24, 2020
Sep 17, 2020
Sep 17, 2020
Sep 24, 2020
Dec 10, 2020
Dec 10, 2020
Sep 17, 2020
Jun 23, 2020
Sep 17, 2020
Sep 17, 2020
Sep 24, 2020
Jul 20, 2020
Dec 14, 2020

Repository files navigation

stream-chat-go

build godoc

the official Golang API client for Stream chat a service for building chat applications.

You can sign up for a Stream account at https://getstream.io/chat/get_started/.

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 (https://getstream.io/chat/).

Installation

go get github.com/GetStream/stream-chat-go/v3

Documentation

Official API docs

Supported features

  • Chat channels
  • Messages
  • Chat channel types
  • User management
  • Moderation API
  • Push configuration
  • User devices
  • User search
  • Channel search
  • Message search

Quickstart

package main

import (
	"os"

	stream "github.com/GetStream/stream-chat-go/v3"
)

var APIKey = os.Getenv("STREAM_CHAT_API_KEY")
var APISecret = os.Getenv("STREAM_CHAT_API_SECRET")
var userID = "" // your server user id

func main() {
	client, err := stream.NewClient(APIKey, []byte(APISecret))
	// use client methods

	// create channel with users
	users := []string{"id1", "id2", "id3"}
	channel, err := client.CreateChannel("messaging", "channel-id", userID, map[string]interface{}{
		"members": users,
	})

	// use channel methods
	msg, err := channel.SendMessage(&stream.Message{Text: "hello"}, userID)
}

Contributing

Contributions to this project are very much welcome, please make sure that your code changes are tested and that follow Go best-practices.