Shopify App Embed Extension: saving data issue

Shopify Partner
13 0 1



I am new to Shopify app development.

I am trying to create an app that accepts email id from the product page (embedded through app extension)


I created a JS file in my asset folder (under the extension folder) that has created a text box and a button.


Now with the click of a button, I want to create a customer with the email ID entered in the textbox.


I am thinking of using GraphQL but I am not sure how to modify the sample code (node.js) in the dev docs for a js code

const client = new shopify.clients.Graphql({session});
const response = await client.query({data: '{your_query}'});


How do I define Shopify object in plane js?
Also, how do I retrieve the "session"





Reply 1 (1)
Shopify Partner
13 0 1

Thanks for replying.


I actually tried something similar but got the error


Uncaught SyntaxError: Cannot use import statement outside a module


I have already added "type": "module" in my package.json but same error.


Is shopify-js-buy is the only option