On this page
Go SDK
github.com/respiresoft/meet-go, standard library only, a context on every call.
go get github.com/respiresoft/meet-goPublishing. The SDK packages are not on npm, PyPI, Packagist or the Go module proxy yet. Until they are, the REST API works from any language over plain HTTPS: every REST reference page has a curl example.
For a task by task start see the server quick start.
Reference from the package README#
Server SDK for the Meet API (rooms, meeting tokens, live control, sessions, transcripts, recordings, webhooks, usage). Go 1.23+, standard library only, typed.
Not published. The module path
github.com/respiresoft/meet-gois a placeholder until the owner publishes the module. Until then, copy the folder or use areplacedirective.
go get github.com/respiresoft/meet-goc, err := meet.New(meet.WithAPIKey(os.Getenv("MEET_API_KEY"))) // mk_test_... or mk_live_...
room, err := c.Rooms.Create(ctx, meet.RoomCreate{Name: "order-1042", Privacy: meet.Private})
tok, err := c.Rooms.CreateToken(ctx, room.Name, meet.TokenCreate{Name: "Ann", Role: meet.RoleHost, TTL: 3600})
// browser: embed("#meeting", { url: room.URL, token: tok.Token })
it := c.Rooms.Iter(ctx, meet.ListParams{}) // every page, automatically
for it.Next() { fmt.Println(it.Item().Name) }
if err := it.Err(); err != nil { /* ... */ }Surface#
c.Whoami(ctx) |
project and mode of the key |
c.Rooms |
Create List Iter Get Update Delete CreateToken CheckToken Presence End Eject Mute MuteAll Message UpdateLive |
c.Sessions |
List Iter Get Transcript TranscriptIter TranscriptText(id, "txt"|"vtt"|"srt", lang) Chat ChatIter |
c.Recordings |
List Iter Get DownloadLink Delete |
c.Webhooks |
List Iter Create Get Update Delete Test RollSecret Deliveries DeliveriesIter ListEvents EventsIter GetEvent Redeliver |
c.Usage |
Get Estimate |
meet.VerifyWebhook(raw, header, secret, opts) |
Meet-Signature check, no client needed; the error matches meet.ErrSignature |
meet.ConstructEvent(raw, header, secret) |
verify, then parse into *meet.WebhookEvent |
meet.SignWebhook(raw, secret, time) |
make a header, for tests of your own receiver |
meet.VerifyToken(ctx, token, opts) |
EdDSA check of a meeting token with crypto/ed25519; set opts.JWKS to stay offline; the error matches meet.ErrToken |
- Context is the first argument of every call. Cancelling it stops the request and any retry wait.
- Lists:
Listreturns a*Page[T](Data,HasMore,Next(ctx), andAll(ctx)forfor item, err := range page.All(ctx)).Iterreturns an*Iterator[T](Next,Item,Err) that followsstarting_afterfor you. - Retries: 429 (honours
Retry-After), 5xx and network errors or per attempt timeouts,WithMaxRetries(default 2) with jittered backoff. Every POST carries anIdempotency-Key(a fresh UUID, the same across retries; passmeet.WithIdempotencyKey("...")to choose it). - Errors:
*meet.ErrorwithCode,Message,Status,RequestID,Param,RetryAfter. Read it witherrors.As. A call that never got an answer hasCode == "connection_error"andStatus == 0.meet.IsNotFound(err)is a shortcut for 404. - Optional fields in request structs are pointers (
*int,*bool) so that "not set" and "false" differ. Room properties this SDK does not know yet go inRoomProperties.Extra, and come back there. - Options:
meet.New(WithAPIKey, WithBaseURL, WithMaxRetries, WithTimeout, WithRetryBaseDelay, WithHTTPClient). Env fallbacks:MEET_API_KEY,MEET_BASE_URL. Per call:WithIdempotencyKey,WithCallMaxRetries,WithCallTimeout.
Webhook receiver and token endpoint with net/http (verify the raw body, never a re-encoded struct):
http.HandleFunc("/meet-webhook", func(w http.ResponseWriter, r *http.Request) {
raw, _ := io.ReadAll(http.MaxBytesReader(w, r.Body, 1<<20))
ev, err := meet.ConstructEvent(raw, r.Header.Get(meet.SignatureHeader), os.Getenv("MEET_WEBHOOK_SECRET"))
if err != nil {
http.Error(w, "bad signature", http.StatusBadRequest)
return
}
log.Printf("event %s", ev.Type)
w.WriteHeader(http.StatusNoContent)
})
http.HandleFunc("/join", func(w http.ResponseWriter, r *http.Request) {
tok, err := c.Rooms.CreateToken(r.Context(), r.URL.Query().Get("room"),
meet.TokenCreate{Name: r.URL.Query().Get("name"), Role: meet.RoleParticipant, TTL: 3600})
if err != nil {
http.Error(w, "could not make a token", http.StatusBadGateway)
return
}
json.NewEncoder(w).Encode(map[string]string{"url": tok.URL, "token": tok.Token})
})Tests#
export GOCACHE=/data/fastuser/go-build GOTMPDIR=/data/fastuser/tmp
go test ./... && go vet ./...