Retrieve delivery customization function id

nomad-developer
Shopify Partner
6 0 0

Hi! I have implemented a Shopify Function extension called delivery-customization. The thing is that I am trying to create a customization through graphql mutation. I know it is working beacause I tested it. I wanted to get done in the path /page/index.jsx, so I add a button to action when click and create the customization. The app was created from template of Node.js. The thing is that I need the functionId variable to use it in the input variables needed for mutation of deliveryCustomizationCreate, and I am not able to get this. Is there a way to retrieve this variable from code?
I've tried with env vars (process.env.SHOPIFY_DELIVERY_CUSTOMIZATION_ID) but return undefined. I have hosted the app to AWS ElastickBeanstalck, and added the SHOPIFY_DELIVERY_CUSTOMIZATION_ID in the environment variables.

I followed this tutorial https://shopify.dev/docs/apps/checkout/delivery-customizations/ui, but unlike how they do it there, I don't want to get the funcitonId from the parameters of a URL.

 

Reply 1 (1)

nomad-developer
Shopify Partner
6 0 0

I manage to do it. It was because the template use Vite, so I needed to add it to vite.config