# NylasConnect.getConnectionStatus()

Source: https://developer.nylas.com/docs/v3/auth/nylas-connect/nylasconnect-class/grant-management-methods/nylasconnect-getconnectionstatus/

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

```ts
// 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.

| 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

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.