Constructor
new Twilio.AccessManager(initialToken)
Construct an AccessManager from an initial Access Token.
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>}
Update the AccessManager's current Access Token.
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:
Name | Type | Description |
---|---|---|
manager |
AccessManager |
- Source:
tokenUpdated
The Access Token was updated.
Parameters:
Name | Type | Description |
---|---|---|
manager |
AccessManager |
- Source: