LiveKit C++ Client SDK v1.4.0
Real-time audio/video/data SDK for C++
Loading...
Searching...
No Matches
livekit::EndpointTokenSource Class Referencefinal

Token source that calls your backend token endpoint over HTTP. More...

#include <token_source.h>

Inheritance diagram for livekit::EndpointTokenSource:
Collaboration diagram for livekit::EndpointTokenSource:

Public Member Functions

std::future< Result< TokenSourceResponse, TokenSourceError > > fetch (const TokenRequestOptions &options={}) override
 

Static Public Member Functions

static std::unique_ptr< EndpointTokenSourcecreate (std::string endpoint_url, TokenEndpointOptions options={})
 Create a token source that fetches credentials from endpoint_url.
 

Friends

struct EndpointTokenSourceTestAccess
 

Detailed Description

Token source that calls your backend token endpoint over HTTP.

Recommended for most production apps: keep API keys server-side, expose a standardized token endpoint, and let the SDK request credentials with room, participant, and agent options.

See also
https://docs.livekit.io/frontends/build/authentication/endpoint/

Member Function Documentation

◆ create()

static std::unique_ptr< EndpointTokenSource > livekit::EndpointTokenSource::create ( std::string  endpoint_url,
TokenEndpointOptions  options = {} 
)
static

Create a token source that fetches credentials from endpoint_url.

Parameters
endpoint_urlURL of your backend token endpoint.
optionsHTTP transport options (method, headers, timeout).
Returns
A configurable token source backed by endpoint_url.

◆ fetch()

std::future< Result< TokenSourceResponse, TokenSourceError > > livekit::EndpointTokenSource::fetch ( const TokenRequestOptions options = {})
overridevirtual
Note
Every fetch issues a fresh HTTP request. Wrap it in CachingTokenSource to reuse credentials between calls.

Implements livekit::TokenSourceConfigurable.


The documentation for this class was generated from the following file: