Shopify / shopify-app-bridge

https://shopify.dev/docs/api/app-bridge
86 stars 9 forks source link

Usage of app bridge in embedded app that is not generated from shopify template #248

Open benzen opened 10 months ago

benzen commented 10 months ago

I'm trying to build an embedded app and using app-bridge to get user authentication from shopify.

Contrary to most shopify docs, this documentation is not sleak.

According to the doc there is two way to import app bridge in from an html file. https://shopify.dev/docs/api/app-bridge-library#getting-started

Which one is good, are both working.

Then what is the api available ??

I understand that the way shopify want to make easy is using the remix prototype.

But others still want to do it the way they want.

Thanks

charlesdobson commented 10 months ago

Hi @benzen,

You can use either method of importing the app-bridge.js file but we recommend using the meta tag approach. So, the Getting Started example:

<head>
  <meta name="shopify-api-key" content="%SHOPIFY_API_KEY%" />
  <script src="https://cdn.shopify.com/shopifycloud/app-bridge.js" ></script>
</head>

As for the available APIs, they're under the References section here: https://shopify.dev/docs/api/app-bridge-library/reference

benzen commented 10 months ago

When running app-bridge like this, I've got an error message in the console saying that the required parameter shop is not provided.

How should i proceed for this ??

What I'm looking for is to get access to shopify's authentication inside my app.

It's unclear how to get my token.

Le mar. 14 nov. 2023 à 16:09, Charlie Dobson @.***> a écrit :

Hi @benzen https://github.com/benzen,

You can use either method of importing the app-bridge.js file but we recommend using the meta tag approach. So, the Getting Started example:

As for the available APIs, they're under the References section here: https://shopify.dev/docs/api/app-bridge-library/reference

— Reply to this email directly, view it on GitHub https://github.com/Shopify/shopify-app-bridge/issues/248#issuecomment-1811314708, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABCFBNFSN2MDQUT636APPDYEPMYVAVCNFSM6AAAAAA7LOHVSKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMJRGMYTINZQHA . You are receiving this because you were mentioned.Message ID: @.***>

-- Benjamin Dreux Conseiller T.I. Président du conseil d'administration Code³ Coopérative de solidarité 438 777 9250