diff --git a/openvidu-node-client/src/Session.ts b/openvidu-node-client/src/Session.ts index a9fead7b..09cde2ee 100644 --- a/openvidu-node-client/src/Session.ts +++ b/openvidu-node-client/src/Session.ts @@ -102,11 +102,11 @@ export class Session { const data = JSON.stringify({ session: this.sessionId, - role: (!!tokenOptions && !!tokenOptions.role) ? tokenOptions.role : OpenViduRole.PUBLISHER, - data: (!!tokenOptions && !!tokenOptions.data) ? tokenOptions.data : '', - kurentoOptions: (!!tokenOptions && !!tokenOptions.kurentoOptions) ? tokenOptions.kurentoOptions : {}, + role: (!!tokenOptions && !!tokenOptions.role) ? tokenOptions.role : null, + data: (!!tokenOptions && !!tokenOptions.data) ? tokenOptions.data : null, + record: !!tokenOptions ? tokenOptions.record : null, + kurentoOptions: (!!tokenOptions && !!tokenOptions.kurentoOptions) ? tokenOptions.kurentoOptions : null }); - axios.post( this.ov.host + OpenVidu.API_TOKENS, data, diff --git a/openvidu-node-client/src/TokenOptions.ts b/openvidu-node-client/src/TokenOptions.ts index 910cd657..51fa4d0d 100644 --- a/openvidu-node-client/src/TokenOptions.ts +++ b/openvidu-node-client/src/TokenOptions.ts @@ -22,6 +22,13 @@ import { OpenViduRole } from './OpenViduRole'; */ export interface TokenOptions { + /** + * The role assigned to this token + * + * @default PUBLISHER + */ + role?: OpenViduRole; + /** * Secure (server-side) data associated to this token. Every client will receive this data in property `Connection.data`. Object `Connection` can be retrieved by subscribing to event `connectionCreated` of Session object. * - If you have provided no data in your clients when calling method `Session.connect(TOKEN, DATA)` (`DATA` not defined), then `Connection.data` will only have this [[TokenOptions.data]] property. @@ -31,9 +38,12 @@ export interface TokenOptions { data?: string; /** - * The role assigned to this token + * Whether to record the streams published by the participant owning this token or not. This only affects [INDIVIDUAL recording](/en/stable/advanced-features/recording#selecting-streams-to-be-recorded) + * + * @default true */ - role?: OpenViduRole; + record?: boolean; + /** * **WARNING**: experimental option. This interface may change in the near future