Integration Guides

Platform-specific guides for integrating Sync As A Service into your application.


Web (Vanilla JavaScript)

The simplest integration—add the SDK script and initialize.

Inline Widget

Embed the widget directly in your page:

<!DOCTYPE html>
<html>
  <head>
    <title>My App</title>
  </head>
  <body>
    <h1>Connect Your Accounts</h1>

    <!-- Widget container -->
    <div id="sync-widget" style="min-height: 500px;"></div>

    <!-- SDK -->
    <script src="https://sync.brandclub.com/sync-sdk/latest/sdk.umd.js"></script>
    <script>
      BrandclubSync.init({
        clientId: "bc_your_app_id",
        environment: "production",
        container: document.getElementById("sync-widget"),

        onSync: (result) => {
          console.log(`Synced ${result.ordersFound} orders`);
          // Refresh your app's data
          location.reload();
        },

        onEvent: (event, metadata) => {
          console.log("Event:", event, metadata);
        },
      });
    </script>
  </body>
</html>

Open the widget as a modal when user clicks a button:


React / Next.js

Basic React Component

Usage

Next.js (App Router)

For Next.js, load the SDK client-side only:


Mobile WebView

Embed the widget in a native mobile app using WebView.

iOS (Swift / WKWebView)

Android (Kotlin / WebView)


Backend-Only (Headless)

For backend integrations without the widget (e.g., data pipelines), use the REST API directly.

Prerequisites

  • Users must have already connected retailers via the widget in another app

  • You have a valid access token for the user

Fetch Orders

Get Connected Retailers

Trigger Manual Sync

See API Reference for complete endpoint documentation.


Environment Configuration

Environment
API URL
Widget URL
Use For

sandbox

sync-beta.brandclub.com

Same SDK, sandbox API

Development

production

sync.brandclub.com

Same SDK, production API

Live apps

Environment Detection


Production Checklist

Before going live:


Next Steps

Last updated