Skip to content

Commit

Permalink
Add metadata parameter to BuildIngressToken (#594)
Browse files Browse the repository at this point in the history
  • Loading branch information
biglittlebigben authored Feb 7, 2024
1 parent eb3e330 commit dd867b5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ingress/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"github.com/livekit/protocol/livekit"
)

func BuildIngressToken(apiKey, secret, roomName, participantIdentity, participantName string) (string, error) {
func BuildIngressToken(apiKey, secret, roomName, participantIdentity, participantName, participantMetadata string) (string, error) {
f := false
t := true
grant := &auth.VideoGrant{
Expand All @@ -36,7 +36,8 @@ func BuildIngressToken(apiKey, secret, roomName, participantIdentity, participan
SetIdentity(participantIdentity).
SetName(participantName).
SetKind(livekit.ParticipantInfo_INGRESS).
SetValidFor(24 * time.Hour)
SetValidFor(24 * time.Hour).
SetMetadata(participantMetadata)

return at.ToJWT()
}

0 comments on commit dd867b5

Please sign in to comment.