Zid Docs
AppsThemes
Payments
AppsThemes
Payments
Help Center
Slack
  1. Mobile Apps
  • Getting Started
    • Introduction
    • Theme Development
    • Vitrin Changelog
    • Creating and Managing Theme Presets
    • Legacy Theme Migration
      • Store Settings Mapping
      • Moving to Vitrin Using LLMs
      • Twig to Jinja
      • Breaking Changes
  • Key Concepts
    • Architecture
    • Templates
      • Overview
      • Overridable Templates
      • Legacy Templates
      • Template Replacements
      • Templates Library
        • home.jinja
        • product.jinja
        • cart.jinja
        • category.jinja
        • products.jinja
        • categories.jinja
        • page.jinja
        • blogs.jinja
        • blog.jinja
        • faqs.jinja
        • reviews.jinja
        • questions.jinja
        • shipping_payment.jinja
        • 404_not_found.jinja
    • Settings
      • Schema files
      • Input Settings
      • Media Settings
      • Form Controls Settings
      • Products Settings
      • Additional Settings
      • Conditional Visibility
      • Migrating twig settings schema
    • Localization
      • localization (jinja v. twig)
    • Theme Editor
      • Overview
  • Building with Vitrin
    • Jinja Basics
    • Vitrin's Jinja Extensions
  • Vitrin CLI
    • Introduction
    • CLI Commands
  • Tips & Tricks
    • Performance
  • JS Integration
    • Supporting both Vitrin and Legacy themes
    • Responses & Errors
    • Cart
    • Products
    • Categories
    • Store
    • Account
    • Blogs
    • Options
    • Events
  • Features
    • SDK Popups – Integration Guidelines
    • Custom Styles Guide
    • Gift Card as a Popup
    • Addresses as a Popup
    • Login as a Popup
    • Checkout as a Popup
    • Apple Pay Quick Checkout
    • Region & Language Popup
    • Dynamic Bundle Products
    • Progressive Discounts
    • Customer Wallet & Cashback
    • Add Preorder Support to Your Theme
  • Mobile Apps
    • Scripts
  • API's
    • Authentication
      • Logout
      • Login Status
      • SMS Login
      • Verify SMS Login
      • WhatsApp Login
      • Verify WhatsApp Login
      • Email Login
      • Verify Email Login
      • Register
      • Register Guest
    • Products
      • List Products
      • Search Products
      • Calculate Product Options Price
      • Notify Product Stock Availability
      • Fetch Bundle Offers
      • Fetch Bundle Offers for a Product
      • List My Product Reviews
      • List Product Reviews
      • Create Product Review
      • Update Product Review
      • Delete Product Review
      • List Product Questions
      • Create Product Question
      • Get Product by Slug
      • Get Selection Groups
    • Categories
      • List Categories
    • Checkout
      • Get Cart
      • Remove Cart
      • Duplicate Cart
      • Add Cart Item
      • Empty Cart
      • Update Cart Item
      • Remove Cart Item
      • Upload Cart Input Field
      • Add Gift Card
      • Remove Gift Card
      • Apply Coupon
      • Remove Coupon From Cart
      • Check Coupon Validity
      • Apply Loyalty Points
      • Remove Loyalty Points
      • Preview Rewarded Points
      • List Redemption Methods for Cart
      • Customer’s Loyalty Wallet
      • Customer’s Current Points Balance
    • Account
      • Get Profile
      • Delete Account
      • Update Customer Profile
      • Get Addresses
      • Create an Address
      • Get an Address by ID
      • Update an Existing Address
      • Delete Address
      • Get Orders
      • Get Shareable Wishlist Link
      • Get Wishlist
      • Add Products to Wishlist
      • Remove Product from Wishlist
      • Get Address Form Schema
      • Check Product Purchase Status
    • Storefront
      • Store Scripts
      • Pages
      • Blogs
    • Countries
      • Get Countries
      • Get Cities By Country
  1. Mobile Apps

Scripts

JS Apps API#

Expose a manifest of approved scripts for your app to consume.
Use this to know what to load and where it’s intended to run inside your hybrid / mobile setup.
📌
This endpoint does not execute anything by itself.
It only returns configuration and script sources for your app to use.

GET /api/v1/scripts#

Auth: Project-specific
Content-Type: application/json
Returns:
external_scripts — remote script URLs.
app_scripts_bundle — inline snippets and reserved keys indicating where scripts are meant to be used.

Example Response#

{
  "external_scripts": [
    {
      "id": 101,
      "src": null,
      "url": "https://cdn.example.com/scripts/tracking-abc123.js",
      "status": 2,
      "app_id": 5001,
      "version": 3
    }
  ],
  "app_scripts_bundle": {
    "scripts": {
      "head": [
        "<script type=\"text/javascript\">\n(function () {\n  var s = document.createElement('script');\n  s.async = true;\n  s.src = 'https://widgets.example.com/support.js';\n  document.head.appendChild(s);\n})();\n</script>"
      ],
      "global_head_script": [
        "<script type=\"text/javascript\">\n(function (w,d,s,u) {\n  var js = d.createElement(s);\n  js.async = true;\n  js.src = u;\n  d.head.appendChild(js);\n})(window,document,'script','https://cdn.example-analytics.com/sdk.js');\n</script>"
      ]
    },
    "params": {
      "snapchatPixelId": "...",
      ...
    }
  }
}

Field Details#

external_scripts#

Remote JS files hosted and approved by the platform.
url — absolute URL to the script file.
Other fields (id, status, app_id, version) support identification and versioning.
Intended usage: load these URLs as normal script files in your chosen runtime.

app_scripts_bundle#

Inline scripts plus reserved keys.
scripts.head
Inline snippets intended for a <head>-like context (early load).
global_head_script
Snippets intended to run once globally (shared initialization, loaders, etc.).
purchase_event
Snippets intended to run once a purchase is completed.
product_details_event
Snippets intended to run once a product's detail page is viewed.
add_to_cart_event
Snippets intended to run once add to cart is executed.
remove_from_cart_event
Snippets intended to run once remove item from cart is executed.
start_checkout_event
Snippets intended to run once the checkout page is started. These should already be covered by the existing checkout page HTML.
params
Contains identifiers like pixel ids or app ids.
These map to function or event names in JavaScript. At this stage they serve as predefined wiring points; dedicated tracking/analytics scripts will be provided separately via URLs and can be obtained through this manifest when available.

Integration Overview#

Hybrid / WebView
React Native (and similar)
Fetch /api/v1/scripts from your native code.
Load external_scripts URLs and inline snippets inside your WebView (e.g. via injected scripts or startup HTML).
Use head / global_head_script placement semantics as guidance for when those scripts should run.

1
1. Call the endpoint
Retrieve /api/v1/scripts during your app's initialization or configuration phase.
2
2. Read the manifest
Inspect external_scripts and app_scripts_bundle to see which scripts and reserved keys are available.
3
3. Apply to your runtime
Inject or reference these scripts according to your app’s architecture (hybrid WebView or JS-based).
Future tracking scripts can be added via new URLs surfaced by the same manifest.
Modified at 2026-02-17 07:02:10
Previous
Add Preorder Support to Your Theme
Next
Logout
Built with