Integration Guides
Web (Vanilla JavaScript)
Inline Widget
<!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-api.stackline.com/sync-sdk/latest/sdk.umd.js"></script>
<script>
SyncSDK.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>Modal Overlay
React / Next.js
Basic React Component
Usage
Next.js (App Router)
Mobile WebView
iOS (Swift / WKWebView)
Android (Kotlin / WebView)
Backend-Only (Headless)
Prerequisites
Fetch Orders
Get Connected Retailers
Trigger Manual Sync
Environment Configuration
Environment
API URL
Widget URL
Use For
Environment Detection
Production Checklist
Next Steps
Last updated
Was this helpful?