Smile.* methods were bundled with Smile UI, which allowed you to fetch and interact with customer and loyalty program data using JavaScript. As of February 2026, these methods are being deprecated and replaced with a new standalone JavaScript SDK library that can be used independently of (or together with) Smile UI. This guide will walk you through what’s new and how to migrate your code.
What’s new
The new JavaScript SDK, Smile.js, is a standalone library can be used with or without Smile UI. It offers methods for fetching and interacting with customer and loyalty program data, and works with modern JavaScript tooling and frameworks. Once you’ve upgraded, you’ll be able to:- Load the SDK via a script tag or a bundler like Vite or Webpack.
- Use included TypeScript type definitions for autocomplete and type checking.
- Preload multiple resources in a single API call to reduce latency and load times.
- Log customers in and out programmatically without a full page reload.
- Access additional data such as detailed customer VIP status and program settings.
How to migrate
To migrate to the new JavaScript SDK, you need to make the following changes to your code. Each step contains instructions and examples to guide you along the way.1. Include the JavaScript SDK
- Shopify
- BigCommerce
- Custom storefront
If you’re using a standard Shopify storefront (not Shopify Hydrogen), ensure that the JavaScript SDK setting is enabled in Smile Admin. This will automatically include the JavaScript SDK on your storefront without additional code required.
2. Update method calls
Any call sites for deprecatedSmile.* methods should be updated to use the corresponding methods from the JavaScript SDK instead.
Old Smile.* method | New JavaScript SDK method |
|---|---|
Smile.createActivity() | Smile.activities.create() |
Smile.customerReady() | Listen for the smile-js-initialized event instead. |
Smile.fetchAllCustomerPointsProducts() | Smile.customerPointsProducts.get() |
Smile.fetchAllPointsProducts() | Smile.pointsProducts.get() |
Smile.fetchAllRewardFulfillments() | Smile.rewardFulfillments.get() |
Smile.fetchCustomer() | Based on the data you need, use any of: • Smile.customer.current() - name & referral URL • Smile.customerPointsWallet.get() - points balance • Smile.customerVipStatus.get() - VIP tier |
Smile.fetchPointsProduct() | Smile.pointsProducts.get() |
Smile.purchasePointsProduct() | Smile.pointsProducts.purchase() (see note) Note: The points_to_spend parameter has changed to pointsToSpend. |
Smile.ready() | Listen for the smile-js-initialized event instead. |
3. Update customer ready calls
TheSmileUI.customerReady() method is now deprecated, and the appropriate replacement depends on what you’re trying to achieve.
- To detect when it’s safe to call other
SmileUI.*methods, use theSmileUI.ready()method. This would typically be for situations where you want to programmatically open the loyalty panel or launcher. - To detect when it’s safe to call other
Smile.*methods, listen for thesmile-js-initializedevent from the JavaScript SDK. This would typically be for situations where you want to programmatically access information about the customer or loyalty program (like displaying their points balance).
- Calling SmileUI.* methods
- Calling Smile.* methods
JavaScript
4. Update object properties
The JavaScript SDK now returns all objects withcamelCase property names (instead of snake_case) for improved compatibility with modern JavaScript frameworks and tooling. As such, you’ll need to update any code that accesses object properties to use the new camelCase names.
5. Audit for preloading
The JavaScript SDK introduces the ability to preload resources, enabling you to retrieve multiple resources on initial page load and reduce the number of roundtrip API calls being made. This helps improve performance and reduce latency, while also providing instant access to preloaded data via new.preloaded() methods on each resource class.
Read our guide on preloading resources, and then audit your code for opportunities to switch from using .get() methods to the new .preloaded() methods instead. Often, it’s as simple as replacing a single .get() call with a single .preloaded() call, like so:
JavaScript
6. Preload points settings
TheSmile.formatPoints() method is now part of the JavaScript SDK and requires that the account’s points settings be preloaded before points values can be formatted.
- Shopify
- BigCommerce
- Custom storefront
If you’re using the
Smile.formatPoints() method, you’ll need to call Smile.preload() with pointsSettings before formatting points.JavaScript
7. Audit manual page reloads
- With Smile UI
- Standalone JavaScript SDK
If you’re including the JavaScript SDK alongside Smile UI (e.g. are still using the rewards panel and launcher), you’ll need to continue to trigger full page reloads after any action that would change the customer’s state or points balance (e.g. logging in or out, redeeming points, completing an activity, etc).Assuming your storefront was already using the rewards panel and launcher prior to beginning the migration process, no changes are required.
8. Check for deprecation warnings
After the completing the migration steps above, you should no longer see any deprecation warnings in the browser console when viewing your storefront. If you do, it means that you’re still using one or more of the deprecatedSmile.* methods and your code requires further updates.