> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Method name: authentication.applySessionToken(token: string) # Method Link: https://dev.wix.com/docs/sdk/host-modules/site/authentication/apply-session-token.md # Method Description: Applies a session token to establish a member session. This function authenticates a member using a session token. The token is usually obtained from [Register](https://dev.wix.com/docs/sdk/host-modules/site/authentication/register.md), [Login](https://dev.wix.com/docs/sdk/host-modules/site/authentication/login.md) methods, or a 3rd-party authentication provider. After applying the token, the member is logged in and has access to member-only content. # Method Permissions: # Method Permissions Scopes IDs: undefined # Method Code Examples: ## Apply a session token received from the backend ```javascript ```typescript import { applySessionToken } from '@wix/authentication'; // Token received from your backend authentication flow const sessionToken = 'your-session-token-from-backend'; try { await applySessionToken(sessionToken); console.log('Session established successfully'); } catch (error) { console.error('Failed to apply session token:', error); } ``` ``` ## Apply a session token from a custom OAuth flow ```javascript ```typescript import { applySessionToken, loggedIn } from '@wix/authentication'; async function handleOAuthCallback(tokenFromOAuth: string) { try { await applySessionToken(tokenFromOAuth); if (loggedIn()) { console.log('OAuth login successful'); // Redirect to member dashboard window.location.href = '/dashboard'; } } catch (error) { console.error('OAuth login failed:', error); } } ``` ```