Hello, i’m working on a Shopify application with a post purchase extension and I’d like to understand how I could recover my metafield data saved with the app installation. It seems that with a post purchase extension we don’t have access to the useAppMetafield or useApi methods. The idea is that the user arrives on the application, can choose an offer to display, save it and then retrieve the data in the extension to display it. I’d like to do all this with a metafield but it’s impossible to retrieve the data. I’ve also tried authenticating to graphQL with the extension’s request token to make a classic query, but with this type of extension it doesn’t seem to work. Do you have any ideas? thank you very much
I’ve created a sample code based on the Shopify documentation, but I haven’t tested it yet. Could you please try the metafield API snippets in my code? If you encounter any issues, I apologize for the inconvenience.
import {
render,
Banner,
useExtensionInput,
} from '@shopify/post-purchase-ui-extensions-react';
import { useEffect } from 'react';
render('Checkout::PostPurchase::Render', () =>
Thank you for you answer. Finally I did a request to my app to retrieve the datas from it and send it back to the extension and it works with the authentification.