Skip to content

Commit 8b4158f

Browse files
committed
docs: add docs comments back in
1 parent fbd0aba commit 8b4158f

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

packages/react/src/TokenSource.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,15 +282,39 @@ export class TokenSourceSandboxTokenServer extends TokenSourceEndpoint {
282282
}
283283

284284
export const TokenSource = {
285+
/** TokenSource.literal contains a single, literal set of credentials. */
285286
literal(literalOrFn: LiteralOrFn) {
286287
return new TokenSourceLiteral(literalOrFn);
287288
},
289+
290+
/**
291+
* TokenSource.custom allows a user to define a manual function which generates new
292+
* {@link ResponsePayload} values on demand.
293+
*
294+
* Use this to get credentials from custom backends / etc.
295+
*/
288296
custom(customFn: CustomFn) {
289297
return new TokenSourceCustom(customFn);
290298
},
299+
300+
/**
301+
* TokenSource.endpoint creates a token source that fetches credentials from a given URL using
302+
* the standard endpoint format:
303+
* FIXME: add docs link here in the future!
304+
*/
291305
endpoint(url: string, options: EndpointOptions = {}) {
292306
return new TokenSourceEndpoint(url, options);
293307
},
308+
309+
/**
310+
* TokenSource.sandboxTokenServer queries a sandbox token server for credentials,
311+
* which supports quick prototyping / getting started types of use cases.
312+
*
313+
* This token provider is INSECURE and should NOT be used in production.
314+
*
315+
* For more info:
316+
* @see https://cloud.livekit.io/projects/p_/sandbox/templates/token-server
317+
*/
294318
sandboxTokenServer(options: SandboxTokenServerOptions) {
295319
return new TokenSourceSandboxTokenServer(options);
296320
},

0 commit comments

Comments
 (0)