@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
1363 227 475

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