Questions and discussions about using the Shopify CLI and Shopify-built libraries.
Hi,
I'm building my custom app using the shopify-cli and shopify_app, and everything was working fine. I'm trying right now to add an external js file to the frontstore, using the config.scripttags as instructed in the docs:
ShopifyApp.configure do |config|
config.application_name = "My Shopify App"
config.api_key = ENV.fetch('SHOPIFY_API_KEY', '').presence || raise('Missing SHOPIFY_API_KEY')
config.secret = ENV.fetch('SHOPIFY_API_SECRET', '').presence || raise('Missing SHOPIFY_API_SECRET')
config.old_secret = ""
config.scope = "write_script_tags" # Consult this page for more scope options:
# https://help.shopify.com/en/api/getting-started/authentication/oauth/scopes
config.embedded_app = true
config.after_authenticate_job = false
config.api_version = "2020-10"
config.shop_session_repository = 'Shop'
config.allow_jwt_authentication = true
config.allow_cookie_authentication = false
config.scripttags = [
{event:'onload', src: 'https://x.x.com/widget/widget.js'}
]
end
However, whenever I install the app i keep getting the following error, and this happens after adding:
config.scripttags = [
{event:'onload', src: 'https://x.x.com/widget/widget.js'}
]
Not sure what might the problem might be. It shouldn't be related to Auth i guess since it was working fine before adding the scripttags config.
any ideas guys? really stuck on this.