Golang API Quick Start
Installation
import (
"github.com/ScaleDrone/scaledrone-go"
)
Usage
Create a new instance of Scaledrone client passing it the channelID
and secretKey
that you can find from your channel's page from Scaledrone's dashboard.
channelID := "channel-id"
secretKey := "secret-key"
client := scaledrone.NewBasicAuthClient(channelID, secretKey)
Sending messages
Rooms are used to isolate different message types. To listen to messages, you need to subscribe to a specific room.
Users can freely connect to multiple rooms (this does not create extra connections).
_ = client.Publish([]byte("Hello Go"), "notifications")