Skip to main content
JavaScript
Smile.fetchCustomer().then(
  (customer) => {
    // Handle the customer object
  }
);

// Reload the customer with VIP tier
Smile.fetchCustomer(
  { include: "vip_tier" }
).then((customer) => {
  // Use customer.vip_tier.name
});
This method is deprecated. Specify includeSdk: true when initializing Smile UI, then use the appropriate method from the JavaScript SDK:
This method fetches the latest information for the currently logged-in customer. It is useful when it’s expected that the customer information has changed since the page loaded. A common example of this is right after a customer has spent points, since their points balance will have been updated in Smile. Reloading the customer object allows you to immediately render the customer’s new points balance.

Parameters

options
object

Returns

This method returns a Promise that:
  • On success, resolves with a customer object.
  • On failure, resolves with an error object.
If the method is improperly invoked (e.g. invalid parameters) or no customer is currently logged-in, the Promise will be rejected.