Created
January 20, 2026 14:01
-
-
Save lukeclifton/2ac7f0730fb7e4a6d5e1d8ec36dab8f8 to your computer and use it in GitHub Desktop.
Shopify UI Extension Debug Hook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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