1. App Snippets
Salla Platform Docs
  • Get Started
  • Create Your First App
  • App Events
  • Handling Add-On Subscriptions
  • Root
  • App Snippets
    • Intro to App Snippets
    • HTML to JavaScript Snippet Migration
  • App Details Builder
    • Get Started
    • App Information
    • App Features
    • App Reviews
    • App Brands
    • App FAQ
    • App Statistics
  • Settings
    • App Setting Details
      GET
    • Update App Settings
      POST
  • Subscriptions
    • App Subscription Details
      GET
    • Subscription Renew
      POST
    • Update Subscription Balance
      POST
Merchant
Merchant
  • Merchant API
  • Embedded SDK
  • Salla OAuth 2.0
Storefront
Storefront
  • Twilight Engine
  • Twilight SDK
  • Web Components
  • Ecommerce Events
  • Component Bundle
  • Checkout APIs
  • Change Log
App Functions
Partner APIs
Partner APIs
  • App API
  • Shipments & Fulfillment APIs
  • Salla AWB
  • Recurring Payments API
  • Billing System Salla partners
  • Communication Apps
Dev Tools
Dev Tools
  • Partners Agent Kit
  • Salla Apps Playbook
  • Salla CLI
Merchant
Merchant
  • Merchant API
  • Embedded SDK
  • Salla OAuth 2.0
Storefront
Storefront
  • Twilight Engine
  • Twilight SDK
  • Web Components
  • Ecommerce Events
  • Component Bundle
  • Checkout APIs
  • Change Log
App Functions
Partner APIs
Partner APIs
  • App API
  • Shipments & Fulfillment APIs
  • Salla AWB
  • Recurring Payments API
  • Billing System Salla partners
  • Communication Apps
Dev Tools
Dev Tools
  • Partners Agent Kit
  • Salla Apps Playbook
  • Salla CLI
Salla - Opensource
Salla - Developers Community
  1. App Snippets

Intro to App Snippets

App Snippet lets you extend any merchant store with custom JavaScript from the App Snippets section in the Salla Partners Portal. The Snippet is injected automatically when your app is installed. Salla uploads your snippet as a .js file to its CDN and serves it on stores that have your app installed, no deployment or hosting needed on your end.
The editor has been rebuilt from the ground up. What was once an HTML field is now a dedicated JavaScript editor, which means raw markup injection is gone, replaced by a CDN-backed pipeline. Save uploads your snippet to the CDN. You can mock public App Settings values and click Refresh preview to test configuration on your demo store without re-saving, but any change to the JavaScript itself requires Save before it appears in the preview.
In this article, we will cover how snippets are injected, how to work with store parameters, and walk through building a live chat integration using tawk.to.
Migration Required
Migrate your App Snippet before 5 September 2026, then publish your updated application through the Salla Partners Portal.
Migration Grace Period: 5 August 2026 – 5 September 2026

Overview#

App Snippet lets you inject custom JavaScript into your merchants' stores. The .js file is uploaded to Salla's CDN when you hit Save in the editor. Once a merchant installs your app, Salla injects that CDN-hosted file into their store automatically.
App Snippet now requires valid JavaScript, no raw HTML or JSX. If you still have legacy HTML snippets, open them in the new editor, rewrite them as JavaScript, and Save to migrate to the CDN pipeline. Migration is required to stay supported on the platform; legacy inline snippets will not receive future improvements.
image.png
If you inspect a store page source after installation, you will find a <script src="..."> tag pointing to a Salla CDN URL, that is where your snippet is being served.
Both Public and Private apps support App Snippet. Scroll down in your app details page on the Partners Portal to find the App Snippet section.
image.png
App Snippet section in the Partners Portal

Add a New Snippet#

image.png
Add new snippet button
When creating a new snippet, the editor presents you with:
FieldDescription
Snippet NameA label to identify your snippet in the portal
JavaScript EditorWrite valid JS code here, HTML and JSX are not accepted
Preview ScreenLive preview of how your snippet renders on a demo store
Store ParametersReserved variables accessible via salla.config.get()
Mock values (Settings parameters only)Set test values for public app.* fields to preview configuration on your demo store without re-saving. Store and user parameters use real data from the selected demo store.
Action ButtonsReset, discards unsaved changes and restores the last saved content. Refresh preview, reloads the demo store iframe and applies current mock values (requires valid JS and a selected demo store). Save, uploads or updates your snippet on the CDN.
image.png
The new App Snippet JS editor
Preview requirements
Before using the preview:
Select a demo store with your app already installed.
Save the snippet at least once so it is available on the CDN.
Mock values apply only to public app.* settings; store and user parameters use live demo-store data.
Snippets are injected in <body>. Maximum script size is 50,000 characters.

Available Parameters#

The following parameters are available across the Store and Customer objects.
store
store.settings
store.meta
store.order_instruction
store.shipping

customer
Store parameters
Store parameters panel
To expose a custom field from App Settings in the App Details page, open the App Settings editor and tick the Public option on the field. It will then be accessible via salla.config.get("app.yourFieldId") in your snippet, where yourFieldId matches the field's ID in App Settings.
Read more about App Settings here.

Mocked Parameter Values#

The editor lets you set mock values for public App Settings (app.*) in the Settings parameters panel. Click Mock values to reveal the inputs, then Refresh preview to apply them.
image.png
Setting mock values in the editor
Click Refresh preview to reload the demo store and apply your current mock values. Remember: JavaScript edits require Save first.
image.png
Preview refreshed with mocked values

Update or Remove a Snippet#

Click the three-dot menu next to any snippet to update or remove it. When you save an update, Salla re-uploads your snippet to the CDN, and the change is reflected on all stores that have your app installed.
image.png
Three-dot menu for snippet actions

JavaScript Rules and Guidelines#

Violating these rules will result in rejection during the app review process.
JavaScript Only
Your snippet must be valid JavaScript. HTML and JSX are not accepted.
No iframes or Embeds
The use of iframe and embed tags is strictly prohibited for security reasons.
No History Manipulation
Functions like history.replaceState() are strictly prohibited for security reasons.
No Dynamic Code Execution
Avoid eval() and similar dynamic code execution, snippets using them will be rejected during app review.
Clean Up Intervals
If you use setInterval(), always conditionally call clearInterval() to prevent memory leaks and repeated background execution.
Minimal Logging
Avoid console.log() for general debugging. Reserve it for cases where something might genuinely go wrong.
Submit Readable Code
Share deobfuscated code separately when submitting for review, for faster feedback.
Keep a Live Demo Store
Maintain at least one demo store with the snippet running so the review team can test it.
Use innerHTML Carefully
Use innerHTML responsibly. Do not use body as a direct reference.
Publish Your Changes
After completing the migration and verifying your snippet works as expected, submit a new publish request of your application through the Salla Partners Portal so merchants receive the updated implementation.
Before publishing, make sure you have:
✅ Migrated your App Snippet to the new JavaScript editor.
✅ Tested the snippet on a demo store.
✅ Verified all functionality works correctly.
✅ Submitted a new app publish request.
For detailed instructions, see the Publishing Your Application guide.
Modified at 2026-08-19 19:48:55
Previous
Handling Add-On Subscriptions
Next
HTML to JavaScript Snippet Migration