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" "log" "livepeer" "livepeer/models/components" ) func main() { lpClient := livepeer.New( livepeer.WithSecurity("") // Your API key ) }
Use the SDK
package main import( "context" "log" "livepeer" "livepeer/models/components" ) func main() { lpClient := livepeer.New( livepeer.WithSecurity("<api-key>"), ) ctx := context.Background() res, err := lpClient.Stream.Create(ctx, components.NewStreamPayload{ Name: "test_stream", }) if err != nil { log.Fatal(err) } if res.Data != nil { // handle response } }
Was this page helpful?