Support Center

Javascript Apps

With javascript you can easily add new components to the store and you can add or change the HTML/CSS without touching the store theme.


Add a Javascript Tag to a Store

You need to have a general Jumpseller App created to be able to add a javascript tag to a store. Make sure you read the article on how to create a general Jumpseller App.

To install the javascript tag on a Jumpseller store, a POST request must be performed:

curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -X POST "https://api.jumpseller.com/v1/jsapps"

with the following JSON content:

{ app :
  {
    url: "https://example/test.js",
    template: "see the options below",
    element: "see the options below"
  }
}

Let’s understand each key-value option:

  • url: The javascript URL that will be loaded on the store.
  • element: The HTML target element to inject the javascript: (head or body)
  • template: The theme template where the javascript will be injected. These are all possible values:
    • category: Products lists by category
    • checkout : All checkout pages
    • home : Home page
    • layout : All pages of the store
    • page: Custom pages
    • product: Product Details

Example : To embed https://example/test.js into the body of all pages use:

{ app :
  {
    url: "https://example/test.js",
    template: "layout",
    element: "body"
  }
}

A Jumpseller App can include several javascript tags on the same store. If you add a javascript for a Jumpseller App on the same template and element where one already exists, the previous one is replaced.

If you need to include several javascripts on the same location or need to include CSS or any assets with the script, you can easily use a package manager like Webpack and bundle everything together for fast loading times.


Other useful API endpoints

To list all the javascript installed on the store by a Jumpseller App use the GET request below:

GET "https://api.jumpseller.com/v1/jsapps/:code"

where code is the code field available at the App edition page after the App was created in the Jumpseller Admin.

This is the cURL version of this request:

curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -X GET "https://api.jumpseller.com/v1/jsapps/:code"

To destroy a javascript tag installed on the store by a Jumpseller App, perform this DELETE request:

DELETE "https://api.jumpseller.com/v1/jsapps/:id"

where id is the id returned from the request used to list all installed javascripts above.

This is the cURL version of this request:

curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -X DELETE "https://api.jumpseller.com/v1/jsapps/:id"

Start your journey with us!

Free trial for 14 days. No credit card required.