Skip to main content

Headless Widget

Create custom widgets within Shopify

Written by Mollie Herbert

Introduction 📖

The headless widget allows you to embed Influence.io loyalty widgets on any headless or custom storefront — including platforms like Alokai, Nuxt, Next.js, or any setup that does not use the standard Shopify or BigCommerce app install.

Requirements

Influence.io Plus Plan or above.

Instructions ⚙️

Embedding widgets on a headless storefront requires a developer. Use the snippets and reference below instead of the standard Shopify or BigCommerce widget install guides.

Widget Types

Each widget type has a dedicated script URL. Load only the script for the widget you need:

Embed Snippet

The example below uses the floating widget. Replace the script src and the JS initializer function name to match your chosen widget type:



  
<script defer="" src="https://widgets.influence.io/dist/floating/main.js"></script>
<script>
  window.addEventListener('DOMContentLoaded', (event) => {
    window.influenceioFloatingWidget();
  });
</script>
  • data-platform="api" is required for headless storefronts — do not use data-platform="shopify".

  • The init div class influenceio-shopify-init is correct even on non-Shopify platforms — do not change it.

  • Include data-customer-email, data-customer-id, and data-customer-digest only when a customer is logged in. Omit all three for guest and anonymous sessions.

  • data-customer-digest must be generated server-side — see the Launcher API docs below for the generation method.

  • No domain allowlisting is required. widgets.influence.io serves static JS bundles with no origin restriction.

⚠️ Common mistake: launcher.api.influence.io is the REST API endpoint — requests to it from a browser will return 403. Always load widgets from https://widgets.influence.io/dist/{widget-type}/main.js.

Custom Domain for Your Referral Program

The 'Set your subdomain' field in the Influence.io dashboard may not save correctly for API and headless platform accounts. This is a known limitation. If you need a custom referral domain, contact support and the team will configure it on the backend.


For the full API reference — including digest generation, advanced widget configuration, and platform API endpoints — see the docs below 👇

Did this answer your question?