Learn how to create your first stream using the Livepeer Go SDK.
Prerequisites
Install the SDK
go get github.com/livepeer/livepeer-go
Initialize the SDK
package main import ( "context" livepeer "github.com/livepeer/livepeer-go" "github.com/livepeer/livepeer-go/models/components" "log" ) func main() { lpClient := livepeer.New( livepeer.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"), ) }
Use the SDK
package main import ( "context" livepeer "github.com/livepeer/livepeer-go" "github.com/livepeer/livepeer-go/models/components" "log" ) func main() { lpClient := livepeer.New( livepeer.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"), ) ctx := context.Background() res, err := lpClient.Stream.Create(ctx, components.NewStreamPayload{ Name: "test_stream", }) if err != nil { log.Fatal(err) } if res.Stream != nil { log.Printf("Stream created successfully") } }
Try it yourself
Was this page helpful?