Skip to content

NylasConnect.getConnectionStatus()

NylasConnect.getConnectionStatus() gets detailed connection status for a grant.

// Get connection status for current session
const status = await nylasConnect.getConnectionStatus();
// Or for a specific grant
const 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.

ParameterTypeDescription
grantIdstring?The ID of the grant to access. If not provided, Nylas Connect uses the grant ID associated with the current session.

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.