login( )


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Logs in a registered member with an email and password.

The login() function only works with existing members. To register a new member use the register() function.

To complete the login, the returned session token must be applied using the applySessionToken() function in the wix-members-frontend API.

Method Declaration
Copy
function login(
  email: string,
  password: string,
  options: LoginOptions,
): Promise<LoginResponse>;
Method Parameters
emailstringRequired

Login email address.


passwordstringRequired

Member password.


optionsLoginOptions

Options for logging in a member.

Returns
Return Type:Promise<LoginResponse>
JavaScript
import { authentication } from "wix-members.v2"; async function login(email, password, options) { try { const result = await authentication.login(email, password, options); return result; } catch (error) { console.error(error); // Handle the error } }
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?