I am setting a programmable voice chat token using the following codes:
const accessToken = new AccessToken(config.accountSid, config.apiKey, config.apiSecret);
accessToken.identity = user_uid;
var grant = new VoiceGrant({
outgoingApplicationSid: config.twimlAppSid,
incomingAllow: false,
});
accessToken.addGrant(grant);
return resolve(JSON.stringify({ token: accessToken.toJwt() }));
With the previous deprecated method: ClientCapability
, I was able to assign an expiration time for the generated capability with ttl property:
const capability = new ClientCapability({
accountSid: config.accountSid,
authToken: config.authToken,
ttl: 300
});
With the new AccessToken
and VoiceGrant
, is it still possible to set an expiration time manually? I did not find any relevant section in the documentation.