Customer login flow
PriceOps library and code to ensure the customer is logged into your app before subscribing
Import npm library in your login flow.
npm i priceops
Install in react code in the login flow.
When a customer logins, call the setCustomer function of Priceops library to set customer.
Usually it is the customer information of the logged in customer.
ID is unique as well as email, between all customers sent to PriceOps.
As an example
// import priceops function from priceops library
import priceops from 'priceops';
// You can include this line in your UI code anywhere after the customer data
// available
// Customer id is the unique customer id in your app
// Customer email is the email your customers use to access your app
priceops.setCustomer(customer.id, customer.email);
// On logout call the below function to remove the customer information from
// priceops library
priceops.onCustomerLogout();
Last updated