Skip to content

NylasConnect.logout()

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

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

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

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