LiveKit.AccessToken (LiveKit v0.1.0)

View Source

Handles generation and management of LiveKit access tokens.

Summary

Functions

Adds a grant to the token.

Creates a new AccessToken with the given API key and secret.

Generates a JWT token string.

Sets the identity for the token.

Sets metadata for the token.

Sets the TTL (time to live) for the token in seconds.

Types

t()

@type t() :: %LiveKit.AccessToken{
  api_key: String.t() | nil,
  api_secret: String.t() | nil,
  grants: LiveKit.Grants.t(),
  identity: String.t() | nil,
  metadata: String.t() | nil,
  ttl: integer() | nil
}

Functions

add_grant(token, grant)

Adds a grant to the token.

new(api_key, api_secret)

Creates a new AccessToken with the given API key and secret.

to_jwt(token)

Generates a JWT token string.

with_identity(token, identity)

Sets the identity for the token.

with_metadata(token, metadata)

Sets metadata for the token.

with_ttl(token, ttl)

Sets the TTL (time to live) for the token in seconds.