NylasConnect.getConnectionStatus()
gets detailed connection status for a grant.
// Get connection status for current sessionconst status = await nylasConnect.getConnectionStatus();// Or for a specific grantconst status = await nylasConnect.getConnectionStatus('<NYLAS_GRANT_ID>');
You can pass no parameters to the method if you want to check the grant associated with the current session. If you want to check a specific grant, pass it as a parameter.
Parameter | Type | Description |
---|---|---|
grantId | string? | The ID of the grant to access. If not provided, Nylas Connect uses the grant ID associated with the current session. |
Return value
Section titled “Return value”The getConnectionStatus()
method returns a Promise<ConnectionStatus>
where ConnectionStatus
is one of the following string values.
connected
: The grant is connected and has a valid access token.expired
: The grant’s access token is expired.invalid
: The grant’s access token is invalid or corrupted.not_connected
: The grant isn’t connected to Nylas, or has no available access token.