INTEGRATION WITH BOGOS JS/SDK

This page provides an overview of the key requirements for integration with the BOGOS app via the BOGOS JS/SDK. It is recommended to read this page thoroughly before proceeding to the next sections

1. Requirements

If you need integration in a development environment, contact BOGOS via live chat or email at help@bogos.io

2. Installation

Version source

  BOGOS_JS_SDK=https://cdn.bogos.io/bogos-app-ext/20251217-1765947613/core.min.js

Step 1: Getting started

  1. Add the following script to your project:

    <script id="bogos-core" src={{BOGOS_JS_SDK}} defer
      data-storefront-api-token={{PUBLIC_STOREFRONT_API_TOKEN}}
      data-api-version={{PUBLIC_STOREFRONT_API_VERSION}}
      data-myshopify-domain={{MYSHOPIFY_DOMAIN}}
      data-bogos-key={{BOGOS_KEY}}
    />

    Property

    Description

    Example

    VERSION_SOURCE: String!

    The script URL for the current version

    https://cdn.bogos.io/{{version}}/core.min.js

    PUBLIC_STOREFRONT_API_TOKEN: String!

    abcd...

    PUBLIC_STOREFRONT_API_VERSION: String!

    2025-04

    MYSHOPIFY_DOMAIN: String!

    Myshopify domain (found in Shopify Admin > Settings)

    bogos.myshopify.com

    BOGOS_KEY: String!

    bogoskey...

    💡 Example Available 👉 root.tsx

  2. Update your project with the required BOGOS data:

    typeof window !== 'undefined' && typeof window.BOGOS_CORE !== 'undefined' &&
      window.BOGOS_CORE?.helper?.updateCore(option: BOGOSOptions)
    export type BOGOSOptions = {
      cart?: Cart;
      customer?: string | Customer;
      locale?: string; https://shopify.dev/docs/api/storefront/latest#@inContext-(Language)
      country?: string; https://shopify.dev/docs/api/storefront/latest#@inContext-(Country-Code)
      currency?: {
        active: string;
        rate: number;
      };
      market?: {
        id: number;
        handle: string;
      }
    };

    Note:

    • You must provide at least one of the above properties.

    • If you provide the full Cart object, BOGOS will not fetch the cart again.

    • If only the Cart ID is provided, BOGOS will fetch the cart again.

    • The customer parameter can be either a customer access token or customer object

    💡 Example Available 👉 root.tsx 👉 Layout.tsx 👉 Cart.tsx

Step 2: Gift Offer

  1. Trigger the gift logic whenever the cart is updated:

    Note:

    • cart: Cart

    • If you provide the full Cart, it won’t fetch again.

    • If only the Cart ID is provided, it will fetch again.

    💡 Example Available 👉 Cart.tsx

  2. Add prepareCheckout to your checkout process to validate gift items before proceeding to checkout:

    💡 Example Available 👉 Cart.tsx

  3. Customize

    3.1. Gift Icon & Gift thumbnail

    • On the product page Add class "fg-secomapp-product-title" where you want to display gift icon Add class "bogos-gift-thumbnail-view" where you want to display gift thumbnail

    or

    💡 Example Available 👉 products.$handle.tsx

    • For collection page Add class "fg-secomapp-collection-img" to where you want to display gift icon on product card

    💡 Example Available 👉 collections.$handle.tsx

    3.2. Cart message

    Add the class "bogos-cart-message-view" to the element where you want the message displayed

    3.3. Gift slider

    To embed the gift slider instead of displaying as a popup, include the following code:

Step 3: Bundle Offer

  1. Classic bundle

    Add the following element to where you want to display the bundle offer.

    Dispatch this element to render the bundle offer

    or

    💡 Example Available 👉 products.$handle.tsx

  2. Mix-match

    Add the following element to where you want to display the bundle offer.

    Dispatch this element to show bundle offer

    or

    💡 Example Available 👉 products.$handle.tsx

Step 4: Bundle Page

Add the following element to where you want to display the bundle offer.

Dispatch this element to render the bundle offer.

💡 Example Available 👉 bundle-page.$id.tsx

Step 5: Upsell Offer

  1. Frequently Bought Together (FBT)

    Add the following element to where you want to display the upsell offer

    Dispatch this element to render the upsell offer

    💡 Example Available 👉 products.$handle.tsx

Step 6: Discount Offer

  1. Volume Discount

    Add the following element to where you want to display the discount offer

    Dispatch this element to render the discount offer

    or

    💡 Example Available 👉 products.$handle.tsx

Step 7: Booster

  1. Progressing bar

    Add the following element to where you want to display the progressing bar

    Dispatch this element to render the progressing bar

    💡 Example Available 👉 Cart.tsx

  2. Today offer

    Add the following element to where you want to display the today offer block

    Dispatch this element to render the today offer block and today offer widget

    💡 Example Available 👉 _index.tsx 👉 Cart.tsx

3. Other integrations

3. 1. Hide gift product (cloned product)

  • If you use products query, you should add : query: "tag_not:bogos-gift"

  • For collection and product page, you can import checkItemIsGift and use returned value to skip gift products or replace to other pages

💡 Example Available 👉 collections.$handle.tsx 👉 products.$handle.tsx

3.2. Customize gift popup/slider

  • Hide all default gift slider elements, and override with your custom implementation.

3.3. Details of additional event listeners

  • fg-gifts:updated: Event gift is updated in cart

💡 Example Available 👉 Layout.tsx

  • fg-cart:auto-updated: Event gift auto add

  • fg-gifts:gift-icon: Show gift icons

  • bogos:message: Show cart message

4. Note

For deeper customization, please contact our support team via live chat or email - help@bogos.io

4.1. Publish Gift/Cloned Products

  • After creating or editing an offer, ensure that the gift/cloned product is published to your Headless channel (or any channel where you want BOGOS to run).

4.2. Some features are not yet available in this version

  • Draft-Order API

  • Automatic volume discount

  • Bundle page button block

  • Some Shopify object-based params (if only id provided, BOGOS will fetch the rest).

Last updated