Helpcenter +918010117117" [email protected]
B4,309-10 Spaze iTech Park, Sector 49, Sohna Road, 122001 Gurgaon India


ms is a global object available in all stores. It is accessible in JavaScript controllers as well as in the templates.


apiThis object is used to call the APIs.
cartIt contains the current cart information.
userIt contains the details of the current user.
pageIt contains the current page details.
deviceIt contains the current device information.
locationIt contains the current location information.
settingsThe property of ms global object which contains the store settings information.
variablesIt contains information about all the variables used in the store theme.
routeParams(deprecated)It contains the stateParams variable information.
preferencesIt contains the store currency and language information.
geo_locationThis property contains the geo location infomation of current user.
searchParamsIt contains the URL query parameters.
substoreIt contains the information about current substore


triggerThis method triggers the specified events for the selected elements.
bindThis method attaches one or more event handlers for selected elements, and specifies a function to run when the event occurs.
goToThis method sets the location of the page to the specified URL.
redirectRedirects user to the given URL. ms.redirect is search engine safe and sends a permanent redirect to the new URL.
loadScriptsThe method to load external script(s). Returns a Promise which is resolved when scripts are loaded.
loadStylesMethod to load external CSS file(s).
fetchA cross-browser implementation of fetch API


To load external script on a particular page

ms.bind("ms.page_change_success", function (event) {
     if ( == "checkout") {
        ms.loadScripts("<url to external script>").then(function() {
             console.log("Script loaded");

Restrict store access only to logged in users

ms.bind('ms.page_change_start', function(event) {
    // Direct user to login page if a user is not logged in.
    if(!ms.user || !ms.user.isLoggedIn){

Redirect user to cart summary page

<button ng-click="ms.goTo('/cart');"> Go to Cart </button>