# NylasConnect.logout()

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

`NylasConnect.logout()` logs the specific grant out by clearing its stored tokens and session data.

```ts
// Logout current session
await nylasConnect.logout();
// Or logout a specific grant
await nylasConnect.logout("<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 associated with the current session. |

## Return value

The `logout()` method returns a `Promise<void>` that resolves when the logout process is complete.