Maciek Wagner
Maciek Wagner

Reputation: 106

Can I create shopify theme extension app, without app?

I have a simple javascript widget rendering the content based on API key from the settings. (I store API keys on my infrastructure) 

I am trying to create a Shopify app, to allow merchants to use my widget.

Using the widget is very simple, all you need to do is add one line of javascript.

I would store the api key setting in metafields then. 

What would be the best way to approach it? I have seen, tutorials like this one

https://www.youtube.com/watch?v=xYz_XMY7jEU&t=301s

where the developer creates the Theme app extension, without creating app itself. Is it possible?

You could store the API key in the metadata then. 

When I try to run the command 

command `extension create

shopify extension generate I have the result "command extension create not found. did you mean version?" 

Do I need to create an app to publish the theme extension?

I want to avoid creating an app, because from what I have seen it requires storing application on an external server, and I would like to create something lighter. 

Or maybe there is a different way to approach it? 

II am using osx, Ruby 2.7.5, Shopify CLI 3.45.4 command extension create did not create an extension I was able to do it only from the Shopify app

Upvotes: 1

Views: 717

Answers (1)

David Lazar
David Lazar

Reputation: 11427

You need an App to contain a theme App extension. When the merchant installs you App, even if all it delivers is a JS widget, they are still installing an App. If you embed a code in a metafield for your JS widget, be aware that that code becomes public knowledge and is not private. You cannot hide codes in the front-end.

Upvotes: 2

Related Questions