Shopify Public App-如何获取钥匙,token& URL
我是Shopify公共应用程序开发的新手,我将需要您的帮助才能更好地了解它。
对于客户,我需要构建一个将由几家商人使用的Shopify公共应用程序。
此应用程序将必须通过管理API访问商家商店。
如果我的理解是正确的,为了通过管理员API访问一个特定的商店,我需要从该商家商店中提供3片信息:公共API密钥,令牌和URL。
现在,我的问题: 当商家安装Shopify Public应用程序时,我的应用程序如何获取这三个信息(特定于该特定商家)? 有什么“魔术”技巧?商人需要输入此信息吗? ...
提前非常感谢您的帮助
I am totally new to Shopify Public App development and I will need your help to understand it a bit better.
For a client, I need to build a Shopify Public App that will be used by several Merchants.
This application will have to access the Merchants' store via the Admin API.
If my understanding is correct, in order to access one specific Merchant's store via the Admin API, I need to have 3 pieces of information from that Merchant's store: the Public API Key, Token and URL.
Now, my question:
When the Shopify Public App is installed by a Merchant, how does my app get these 3 pieces of information (specific to that particular merchant) ?
Is there any "magic" trick? Does the Merchant need to input this info? ...
In advance, many thanks for your help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
对于那些可能有兴趣的人,我终于找到了指向信息的链接。
shopify- oauth 开始
For those who might be interested, I finally found the link to the information.
Shopify - Getting started with OAuth
每个商人都需要安装您的应用程序。在安装阶段中,Shopify将通过参数将访问令牌通过,即您需要的令牌,以便使用Admin API。
如果我们谈论的是一个嵌入式应用程序,则可以预见到每个请求都经过身份验证。
取决于您要创建的应用程序(或者嵌入式)和可能要使用的语言,使用Shopify CLI创建应用程序的初稿。它将创建一个可安装应用程序的基础。这是文档 https://shopify.dev/apps/getting-petting-started/create/create/create
您需要安装Shopify CLI,然后运行
Shopify App create(Node | Ruby | PHP)
根据您选择的语言。
Each merchant will need to install your app. In the installation phase shopify will pass, as an argument, the access token, that is a token that you will need, to use the Admin API.
If we're talking about an embedded app is expected that every request made is authenticated.
Depending on which kind of app you want to create (embedded or not) and language you may want to use, using the Shopify Cli to create the first draft of the app is really reccommended. It will create the base to have an installable app. Here is the documentation https://shopify.dev/apps/getting-started/create
You need to install the Shopify Cli and then run
shopify app create (node | ruby | php)
depending on your language of choice.
对于现在阅读本文的任何人,我最近都在同样的问题上挣扎。
Flow
这是一个简单的过程:
离线访问令牌
。访问令牌
才能直接从您的后端获取有关商店的数据(在这种情况下为节点应用程序)。如何从Remix App(由官方模板制成)获取访问令牌
此代码在官方文档
在这里,您可以安装
session
,并从中获得access_token
,这对于任何新尝试的人来说可能会有些混乱。但我希望这会有所帮助!
For anyone reading this now, I recently struggled with the same problem.
Flow
Here is a simple process:
offline access token
.access token
from remix app to get data about the shop directly from your backend (Node app in this case).How to get the access token from remix app (made from official template)
This code is provided in the official docs
Here you can console the
session
and get theaccess_token
from itThis can be a little confusing for anyone new trying out. But I hope this helps!