Skip to main content

How it works

Stay AI provides an interactive portal that allows customers to view and manage their subscriptions when logged in to your Shopify store. Using custom HTML, CSS, and JavaScript, you can display a loyalty section inside the Stay AI customer portal whose data is powered by Smile’s JavaScript SDK.
The sample code provided on this page is intended as a starting point only and may need to be adjusted to fit your specific needs. Smile does not provide support for creating, updating, or maintaining custom code over time.

What it includes

The provided sample code adds the following to the Stay AI customer portal:
  • A loading state that displays while the loyalty program information is being retrieved.
  • The customer’s points balance and VIP tier.
  • A list of unused rewards that can be applied to future purchases.
  • All available redemption options, including the ability to redeem.
  • Ways to earn more points within the loyalty program.
  • The customer’s referral URL and referral program information.
The various components will be automatically hidden or shown based on how your loyalty program is configured.

What it looks like

The loyalty section will inherit the styles of the Stay AI customer portal, including your chosen color scheme, fonts, and button styles. The loyalty section will also be responsive and will dynamically adjust based on the screen size. With the Stay AI default customer portal design, the loyalty section will look like the following: Stay AI customer portal Smile loyalty section

Setup instructions

In Smile

  1. In Smile Admin, navigate to Settings > Developer Tools.
  2. In the JavaScript SDK card, click Enable. If it is already enabled, proceed to the next step.

In Stay AI

  1. In the Stay AI admin interface, navigate to Legacy Portal > Design.
  2. At the bottom of the page, expand the CSS section and paste in the following:
CSS
  1. Expand the HTML section and paste in the following:
HTML
  1. Expand the JavaScript section and paste in the following:
JavaScript
  1. Click the Submit button at the top of the page to save your changes.
Changes won’t be reflected in the customer portal preview, but you can test the setup by logging in to your store and visiting the Stay AI customer portal on your website. The link to the Stay AI customer portal is in the following format (make sure to replace your-store-url.com with your actual store URL):

Known limitations

  • The loyalty section is only available to customers who are logged in directly to your Shopify store. If a customer logged in to your store via a Stay AI link, they will not see the loyalty section.