import { WorkOS } from '@workos-inc/node'; const workos = new WorkOS('sk_test_123'); const logoutUrl = workos.userManagement.getLogoutUrl({ sessionId: 'session_01HQAG1HENBZMAZD82YRXDFC0B', returnTo: 'https://your-app.com/signed-out', });
userManagement .getLogoutUrl()Parameters objectReturns Generates the logout URL by extracting the session ID from the session cookie. Use this over getLogoutUrl if you don’t have a saved reference to the session ID and you’d like the SDK to handle extracting the session ID from the cookie for you.
import { WorkOS } from '@workos-inc/node'; const workos = new WorkOS('sk_test_123'); const logoutUrl = workos.userManagement.getLogoutUrlFromSessionCookie({ sessionData: 'sealed_session_cookie_data', cookiePassword: 'password_previously_used_to_seal_session_cookie', });
userManagement .getLogoutUrlFromSessionCookie()Parameters objectReturns