Local debugger and shim for Shopify Polaris App Bridge APIs.
This package lets a Shopify embedded app keep calling the normal App Bridge API during local development:
import { useAppBridge } from "@shopify/app-bridge-react";
const shopify = useAppBridge();
shopify.modal.show("delete-modal");
shopify.toast.show("Saved");
const products = await shopify.resourcePicker({ type: "product" });When debugger mode is enabled, @shopify/app-bridge-react is aliased to this package's local shim. Your app code does not need to change.
bun add -d shopify-debugger// vite.config.ts
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { shopifyDebugger } from "shopify-debugger/vite";
export default defineConfig({
plugins: [react(), shopifyDebugger()],
});Run local dev with debugger mode:
SHOPIFY_DEBUGGER=true bun run devSHOPIFY_APP_BRIDGE_DEBUG=true also works.
When enabled, the Vite plugin also registers a local debugger shell at:
http://localhost:5173/_debuggerOpen that route to load your app inside a lightweight iframe host. This gives you a local Shopify-like debugging surface without going through admin.shopify.com.
You can customize the route or the iframe URL:
shopifyDebugger({
debuggerRoute: "/_debugger",
appUrl: "/?shop=debug-store.myshopify.com&embedded=1",
});Set debuggerRoute: false to disable the route while keeping the App Bridge alias.
You do not need to add a debug panel to the client app. The primary flow is zero client-code changes: open /_debugger and use the shell panel there.
The exported <ShopifyDebuggerPanel /> still exists as an optional escape hatch for apps that cannot use the iframe shell route.
This package uses changelogen for changelog and release automation.
Dry-run release notes:
pnpm run release:dryBuild, update changelog, tag, and push:
pnpm run releaseBuild, update changelog, tag, push, and publish to npm:
pnpm run release:publishThis repo includes a runnable example app:
cd example
pnpm install
pnpm run devThen open:
http://127.0.0.1:5173/_debuggerThe example imports useAppBridge from @shopify/app-bridge-react normally. Only its Vite config uses shopifyDebugger().
Initial shim support:
useAppBridge()from@shopify/app-bridge-reactshopify.modal.show(id)shopify.modal.hide(id)shopify.modal.toggle(id)shopify.toast.show(message, options?)shopify.resourcePicker(options)shopify.loading.show()/shopify.loading.hide()shopify.saveBar.show(id)/shopify.saveBar.hide(id)shopify.navigation.navigate(destination)
The /_debugger shell shows a local event timeline and lets you switch resource picker behavior between:
successcancelerrormanual
When resource picker mode is manual, calls to shopify.resourcePicker(...) stay pending until you resolve, cancel, or reject them from the /_debugger shell.
When shopify.modal.show('my-modal') is called, the debugger tries to find document.getElementById('my-modal') and adds open plus data-shopify-debugger-open="true".
A small CSS fallback is included for ui-modal[data-shopify-debugger-open="true"] so App Bridge modal content is visible locally.
import { shopifyDebugger } from "shopify-debugger";
shopifyDebugger.__debug.setResourcePickerMode("cancel");
shopifyDebugger.__debug.setResourcePickerResponse([
{
id: "gid://shopify/Product/123",
title: "Custom debug product",
},
]);This package mimics the public App Bridge API shape for local debugging. It does not emulate Shopify Admin, OAuth, billing, permissions, or the real Admin iframe host protocol.