Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

@shopify/shopify-api empty scopes not working.

@shopify/shopify-api empty scopes not working.

dancargill
Shopify Partner
2 0 0

I've been given feedback on an app to remove scopes not in use by my app.

This would mean my app requires no scopes, however when I try to pass empty scopes, I receive an OAuth error invalid_scope error.

 

const shopify = shopifyApi({
  ...otherStuff,
  scopes: [' ']
})

 

 I've tried many different methods, setting scope to: undefined, null, [], [''], [' ']. None of these work and all repeat the same error.

How can I get around this?

payday_0-1682464862726.png

 

Replies 2 (2)

dancargill
Shopify Partner
2 0 0

ShopifyDevSup
Shopify Staff
1453 239 535

Hi @dancargill,

 

While the official place for support of the libraries are the public GitHub repositories, eg. [for the Node JS library], the [OAuth Documentation] doesn't say anything about any of the fields in the exchange that includes the scopes being optional. This suggests that specifying at least one scope is required.

 

Hope you have a great day

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog