NylasConnect.logout()
logs the specific grant out by clearing its stored tokens and session data.
// Logout current sessionawait nylasConnect.logout();// Or logout a specific grantawait 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
Section titled “Return value”The logout()
method returns a Promise<void>
that resolves when the logout process is complete.