ParticipantToken class

Constructors

ParticipantToken.new({required String name, required String? projectId, required String? apiKeyId, Map<String, dynamic>? extra, List<ParticipantGrant>? grants})
ParticipantToken.fromJson(Map<String, dynamic> json)
Creates a ParticipantToken from a JSON Map.
factory
ParticipantToken.fromJwt(String jwtStr, {String? token, bool verify = true})
Decodes a JWT string to create a ParticipantToken. If token is not provided, tries to read from ENV 'MESHAGENT_SECRET'.
factory

Properties

apiKeyId String?
final
extra Map<String, dynamic>?
final
grants List<ParticipantGrant>
final
hashCode int
The hash code for this object.
no setterinherited
isAgent bool
no setter
name String
final
projectId String?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addRoleGrant(String role) → void
addRoomGrant(String roomName) → void
Adds a 'room' grant to the participant token.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts this object to a JSON-compatible Map.
toJwt({String? token}) String
Encodes this object as a JWT string. If token is not provided, tries to read from ENV 'MESHAGENT_SECRET'. extraPayload merges additional data into the JWT payload.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited