User Actions
fetchRegisterUrl
Section titled “fetchRegisterUrl”Fetches the URL for user registration.
import { fetchRegisterUrl } from '@shopgate/engage/user';
dispatch(fetchRegisterUrl());fetchUser
Section titled “fetchUser”Fetches the data of the current user.
import { fetchUser } from '@shopgate/engage/user';
dispatch(fetchUser());Log in a user.
import { login } from '@shopgate/engage/user';
dispatch(login({login: 'user@email.com', password: 'password123'}, '/checkout', 'basic'));Parameters
Section titled “Parameters”parameters(Object): The login credentials.login(string): The username.password(string): The password.
redirect(string) : The location to direct the user after login.strategy(string) Login method, such as ‘basic’, ‘facebook’, or ‘amazon’.
logout
Section titled “logout”Log out the current user.
import { logout } from '@shopgate/engage/user';
dispatch(logout());
