Hey @Banibrata_Manna - thanks for sharing the snippet there! I don’t have too much experience with Ionic/Vue, but since you’re using App Bridge, you should be able to use these POS APIs:
You’d want to set up something like this potentially:
const createShopifyAppBridge = async () => {
try {
const host = new URLSearchParams(location.search).get('host') || "";
const shop = new URLSearchParams(location.search).get('shop') || "";
const apiKey = 'your-api-key-here';
const shopifyAppBridgeConfig = {
apiKey: apiKey,
host: host,
forceRedirect: true,
};
const appBridge = createAppBridge(shopifyAppBridgeConfig);
try {
const user = await shopify.pos.user();
const location = await shopify.pos.location();
console.log('POS User:', user);
console.log('POS Location:', location);
} catch (posError) {
console.error('POS data not available - app may not be running in POS context:', posError);
}
return appBridge;
} catch (error) {
console.error('Failed to create App Bridge:', error);
throw error;
}
}
We can’t always help with code-level troubleshooting, but let me know if you encounter any other issues with this and I’d be happy to help out as best I can