Building an Chatbot Custom app

Hey there,

I’m looking to publish an app that integrates a chatbot into the Merchants storefront. Chatbot can be easily integrated using Javascript.

The idea is that settings for the chatbot will be handled on the chatbot’s platform. Merchant signs up on chatbot’s platform and sets up the chatbot. The merchant will then install the Shopify App which will fetch the Javascript via API and injects it into Liquid Theme.

This means that the app will be free on Shopify (for integration only), but chatbot itself will be handled on its own platform.

so It will be Very helpful to provide me with an API can inject the Javascript into Liquid Theme as i tried to use ScriptTag API but our Javascript exceeded the character limitation 255

Hey @Aya-Ibrahim

Consider using theme app extensions: https://shopify.dev/docs/apps/online-store/theme-app-extensions/extensions-framework#app-embed-blocks

Hey @SBD

Please consider that the app is a public app

Hello! I’m on the same team as Aya, and I wanted to discuss an issue we’re facing.

The problem we’re encountering is that each script we need to use is unique to each store, and it’s generated specifically for that store. The main method we’ve been exploring is using the Script_Tag endpoint. However, there’s a significant challenge due to the limitation of the script_url length, which is set at 255 characters. Unfortunately, our scripts are much longer than this limit.

The approach you mentioned seems like it could work if we were dealing with a unique store, and the app was private, allowing for customization. However, as our app is public and listed, I have doubts about whether this approach is feasible. Please correct me if I’ve misunderstood your suggestion, or if you have any alternative ideas.

Hey @BYY2100

Confirming the script URL length is > 255 character, not the actual script itself? And could you give an example of the long URL?

Hey @SBD

Note: the script is not static and it can changed by any change done in the chat widget settings, it’s unique for each user
The data has been hidden from the script, but with the same number of characters
HYG

cc @BYY2100

Ah I see - would it be possible to store the config elsewhere? Script tags are affixed with a ?shop param and you can use it to obtain config details.

E.g. dummydata.com/webchat.js?shop=some-store.myshopify.com

Unfortunately, it is not possible. the script is standardized in our platform and can’t be changed because it has a lot of apps depending on it, so we can’t change its structure