Constructor
new Twilio.AccessManager(initialToken)
Parameters:
| Name |
Type |
Description |
initialToken |
string
|
The initial Access Token |
Properties:
| Name |
Type |
Attributes |
Description |
identity |
string
|
<nullable>
|
The identity granted by the current Access
Token; this value is populated asynchronously and is initially null |
token |
string
|
|
The current Access Token |
isExpired |
boolean
|
|
Whether or not the current Access Token is
expired |
expires |
Date
|
<nullable>
|
The time at which he current Access Token
expires; this value is populated asynchronously and is initially null |
- Source:
Fires:
Methods
updateToken(newToken) → {Promise.<this>}
Parameters:
| Name |
Type |
Description |
newToken |
string
|
A new Access Token |
- Source:
Fires:
Returns:
-
Type
-
Promise.<this>
Events
error
An error occurred.
Parameters:
| Name |
Type |
Description |
error |
Error
|
|
- Source:
tokenExpired
The Access Token expired.
Parameters:
- Source:
tokenUpdated
The Access Token was updated.
Parameters:
- Source:
tokenWillExpire
The Access Token will expire in 3 minutes
(or less if token TTL is less then 3 minutes).
Parameters:
- Source: