As a developer I want to develop a toggle button for the QRCode component, that will allow merchants to control when the extension should be printed. When attempting to use the Storage API within a POS UI extension targeting pos.receipt-footer.block.render, the API does not function as expected.
Steps to Reproduce:
-
Create a POS UI extension targeting
pos.receipt-footer.block.render. -
Write value to StorageAPI from any extension. Try to toggle between false/true.
-
Deploy and run the extensions in Shopify POS.
-
Observe that QRCode is always printed - meaning storage API does not affect it (falls back to “true” value).
import React, { useEffect, useState } from 'react';
import {
reactExtension,
useApi,
POSReceiptBlock,
QRCode,
} from '@shopify/ui-extensions-react/point-of-sale';
const Block = () => {
const {transaction} = useApi<'pos.receipt-footer.block.render'>();
const api = useApi<'pos.receipt-footer.block.render'>();
const [qrEnabled, setQrEnabled] = useState(true);
// Load global QR settings
useEffect(() => {
const loadSettings = async () => {
try {
const qrSettings = await api.storage.get('qr_settings') as any;
const globalEnabled = qrSettings?.show_qr_code ?? true;
setQrEnabled(globalEnabled);
} catch (error) {
setQrEnabled(true);
}
};
loadSettings();
}, []);
// If transaction type is exchange, show empty POSReceiptBlock
if (transaction.transactionType === 'Exchange') {
return <POSReceiptBlock />;
}
// If QR code is disabled globally, show empty POSReceiptBlock
if (!qrEnabled) {
return <POSReceiptBlock />;
}
return (
<POSReceiptBlock>
<QRCode value={`${transaction.orderId ?? 'undefined'}`} />
</POSReceiptBlock>
);
};
export default reactExtension('pos.receipt-footer.block.render', () => (
<Block />
));
Expected Behavior: The Storage API should be available and functional within the pos.receipt-footer.block.render target, allowing extensions to persist and retrieve data as in other POS UI extension targets.
Tried with 2025-07 api and “@shopify/ui-extensions-react”: “2025.7.1”,