issueCollaborationTokenWithHttpInfo method
Future<Response>
issueCollaborationTokenWithHttpInfo({
- IssueCollaborationTokenRequest? issueCollaborationTokenRequest,
Exchange a bearer token for a short-lived Yjs collaboration JWT.
The Yjs Cloudflare Worker that powers live document collaboration (wss://realtime-collaboration.<account>.workers.dev) only accepts platform-signed JWTs. Third-party clients holding an OAuth access token or PAT call this endpoint to mint a 5-minute collaboration JWT they can present to the worker. The minted JWT inherits user + workspace identity from the presenting bearer token. Optionally scope it to a single room by supplying room in the request body.
Note: This method returns the HTTP Response.
Parameters:
- IssueCollaborationTokenRequest issueCollaborationTokenRequest:
Implementation
Future<Response> issueCollaborationTokenWithHttpInfo({ IssueCollaborationTokenRequest? issueCollaborationTokenRequest, }) async {
// ignore: prefer_const_declarations
final path = r'/v1/realtime/collaboration-token';
// ignore: prefer_final_locals
Object? postBody = issueCollaborationTokenRequest;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
path,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}