最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

toml - Shopify checkout extension network_access issue - Stack Overflow

programmeradmin4浏览0评论

I am developing a Shopify checkout customisation app which includes some extensions of type 'ui_extension'. The extensions need to make some API calls, so following the documentation I have network_access = true in the extesions .toml file, but am still receiving the following error every time

20fa7b5ad880a85d8f39cf44d7b100f6.js:19537 Error fetching banner config: ExtensionUsageError: permission to use fetch() must be specified under [capabilities] with flag "network_access = true"; this can be done within your extension's configuration. View the docs for more information:

Here is the content of my toml file:

api_version = "2025-01"

[[extensions]]
name = "custom-message-block"
handle = "custom-message-block"
type = "ui_extension"

[[extensions.targeting]]
module = "./src/Checkout.tsx"
target = "purchase.checkout.block.render"

[extensions.capabilities]
api_access = true
network_access = true

I'm at a complete loss here - I've deleted the .shopify folder and completeley restarted the app in case of any caching issues but still no luck.

If anybody has any idea what my issue may be, it would be greatly appreciated!

I am developing a Shopify checkout customisation app which includes some extensions of type 'ui_extension'. The extensions need to make some API calls, so following the documentation I have network_access = true in the extesions .toml file, but am still receiving the following error every time

20fa7b5ad880a85d8f39cf44d7b100f6.js:19537 Error fetching banner config: ExtensionUsageError: permission to use fetch() must be specified under [capabilities] with flag "network_access = true"; this can be done within your extension's configuration. View the docs for more information:

Here is the content of my toml file:

api_version = "2025-01"

[[extensions]]
name = "custom-message-block"
handle = "custom-message-block"
type = "ui_extension"

[[extensions.targeting]]
module = "./src/Checkout.tsx"
target = "purchase.checkout.block.render"

[extensions.capabilities]
api_access = true
network_access = true

I'm at a complete loss here - I've deleted the .shopify folder and completeley restarted the app in case of any caching issues but still no luck.

If anybody has any idea what my issue may be, it would be greatly appreciated!

Share Improve this question edited Mar 11 at 15:55 Drew Reese 204k18 gold badges245 silver badges273 bronze badges asked Mar 11 at 6:49 Dave ClydesdaleDave Clydesdale 13 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

I've found the problem this morning.

In addition to the toml entry you also need to request API access for the app via the partners.shopify dashboard.

Navigate to

apps > [YOUR APP] > API access

and under 'Allow network access in checkout UI extensions, click Allow network access' you need to select 'Request Access'

With that updated I'm able to make API calls from my extension components

发布评论

评论列表(0)

  1. 暂无评论