Skip to content

User Actions

Fetches the URL for user registration.

import { fetchRegisterUrl } from '@shopgate/engage/user';
dispatch(fetchRegisterUrl());

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 (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’.

Log out the current user.

import { logout } from '@shopgate/engage/user';
dispatch(logout());