Skip to content

Instantly share code, notes, and snippets.

@lukeclifton
Created January 20, 2026 14:01
Show Gist options
  • Select an option

  • Save lukeclifton/2ac7f0730fb7e4a6d5e1d8ec36dab8f8 to your computer and use it in GitHub Desktop.

Select an option

Save lukeclifton/2ac7f0730fb7e4a6d5e1d8ec36dab8f8 to your computer and use it in GitHub Desktop.
Shopify UI Extension Debug Hook
import { useExtension } from '@shopify/ui-extensions-react/checkout';
import { UIExtensions } from '../enums';
export function useDebug(extensionName: UIExtensions, debugMode: boolean) {
const extension = useExtension();
return function debug(message: any, params?: any) {
if (debugMode) {
console.log(`[UI Extension: ${extensionName.toUpperCase()}] ${message}`, params)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment