Wix.Dashboard

closeWindow

Closes the modal endpoint.

SDK Version: SDK 1.27.0+
Display: Dashboard, Modal

Syntax:

Copy

Parameters:

NameTypeDescription
messageObjectA custom message to pass to the calling endpoint’s onClose callback function

Example:

Copy

getEditorUrl

Retrieves a URL for the app in the Editor. If your app is installed on more than one page, the first page that contains your app will be opened. If the user didn’t install the Site component yet, this will return a URL to the Wix Editor that will open the App Market with your app in pending.

SDK Version: SDK 1.33.0+
Display: Dashboard

Syntax:

Copy

Note:
This is only relevant for apps that have both a site component and a dashboard component.

Parameters:

NameTypeDescription
callback (required)FunctionCallback function to receive the URL that directs users to the app in the Wix Editor

Value passed to callback: The URL that directs users to the app in the Wix Editor. Note that:

  • If your app is installed on more than one page, the URL directs to the first page that contains your app.
  • If the user didn’t install the Site component yet, the URL directs to the App Market in the Wix Editor, with your app in pending.

Example:

Copy

getProducts

Returns a json with pricing information for all of your app’s packages – premium plans and in-app purchase packages.

SDK Version: SDK 1.72.0+
Display: Dashboard

Syntax:

Copy

Parameters:

NameTypeDescription
onSuccess (required)FunctionA callback function to receive the pricing information
onErrorFunctionA callback function for when an error occurs

Example:

Copy

getSiteViewUrl

Retrieves the live site’s base URL.

SDK Version: SDK 1.74.0+
Display: Dashboard

Syntax:

Copy

Parameters:

NameTypeDescription
onSuccess (required)FunctionA callback function to receive the base url object

Value passed to callback:

An object with the base URL of the live site. For example: {base : “http://www.wix.com”}

Example:

Copy

openBillingPage

Allows the app to open the Wix billing page.

SDK Version: SDK 1.27.0+
Display: Dashboard

Syntax:

Copy

Example:

Copy

openMediaDialog

This method opens the Wix Media Manager, which allows users to choose an existing item from the Wix media galleries or upload a new file.

SDK Version: SDK 1.27.0+
Display: Dashboard

Once the user selects a media item, a callback function returns a metadata descriptor with details about it.

To access the media item, use one of the Wix.Utils.Media.get* methods to construct the item’s full URL. You’ll need the item’s relativeUri, which is returned in the callback function.

Warning:
Use the Wix.Utils.Media.get* methods each time you access the media item, to prevent broken links.

Syntax:

Copy

Parameters:

NameTypeDescription
mediaType (required)Wix.Settings.MediaType.IMAGE,Wix.Settings.MediaType.BACKGROUND,Wix.Settings.MediaType.AUDIO,Wix.Settings.MediaType.SECURE_MUSIC, Wix.Settings.MediaType.DOCUMENT,Wix.Settings.MediaType.SWFType of media item the user is selecting: IMAGE (photo/image), BACKGROUND (background image), AUDIO (mp3 file up to 50MB), SECURE_MUSIC (high quality audio up to 360MB), DOCUMENT, SWF
multiSelect (required)Booleantrue if the user selected more than one item. false if the user selected only one item.
onSuccess (required)FunctionCallback function to pass metadata about this media item
onCancelFunctionCallback function called when the user cancels

Value passed to onSuccess callback:

An object or an array of objects (for multiple media items).

Each object contains metadata about a specific media item.

Example:

Copy

openModal

Opens a lightbox-style modal window over your app in the Wix Dashboard. You can only open this modal from the Wix Dashboard.

SDK Version: SDK 1.27.0+
Display: Dashboard

Here’s how the modal works:

  • The modal is a singleton – every new modal closes the previous one.
  • Users can close the modal by clicking the lightbox or pressing the close button. You can close the modal by calling Wix.closeWindow from within the modal iframe.

Syntax:

Copy

Parameters:

NameTypeDescription
url (required)StringURL of the modal iframe
width (required)NumberWidth of the modal, in pixels (for example, 400)
height (required)NumberHeight of the modal, in pixels (for example, 400)
onCloseFunctionOnClose callback function
themeWix.ThemeThe style of the modal: Wix.Theme.DEFAULT - has the regular modal look & feel - border, shadow, close button. Wix.Theme.BARE - a simple modal with no border, close button, shadow, etc.

Example:

Copy

pushState

Enables AJAX style Page apps to inform the Wix platform about a change in the app internal state. The new state will be reflected in the site/page URL. Once you call the pushState method, the browser’s top window URL will change the ‘app-state’ path part to the new state you provide with the pushState method (similar to the browser history API). Read more about deep linking for a full explanation.

SDK Version: SDK 1.35.0+ Display: Dashboard

Syntax:

Copy

Parameters:

NameTypeDescription
state (required)StringThe new app's state to push into the dashboard history stack

Example:

Copy

revalidateSession

Verifies that the session is secure. If the session is secure, this method returns a newly-signed app instance.

SDK Version: SDK 1.52.0+
Display: Dashboard

Use this method before displaying sensitive information or performing an action that requires a secure session.

Syntax:

Copy

Parameters:

NameTypeDescription
onSuccess (required)FunctionReceives a newly-signed and encoded app instance
onFailureFunctionCallback function in case the session isn't secure

Example:

Copy

Deprecated

openModal

Opens a lightbox-style modal window over your app in the Wix Dashboard. You can only open this modal from the Wix Dashboard.

SDK Version: Deprecated
Display: Dashboard

Here’s how the modal works:

  • The modal is a singleton – every new modal closes the previous one.
  • Users can close the modal by clicking the lightbox or pressing the close button. You can close the modal by calling Wix.closeWindow from within the modal iframe.

Syntax:

Copy

Parameters:

NameTypeDescription
url (required)StringURL of the modal iframe
width (required)NumberWidth of the modal, in pixels (for example, 400)
height (required)NumberHeight of the modal, in pixels (for example, 400)
onCloseFunctionOnClose callback function
themeWix.ThemeThe style of the modal: Wix.Theme.DEFAULT - has the regular modal look & feel - border, shadow, close button. Wix.Theme.BARE - a simple modal with no border, close button, shadow, etc.

Example:

Copy

setHeight (height)

SDK Version: Deprecated

Requests the hosting Wix platform to change the iframe’s height inside the side dashboard

Parameters:

NameTypeDescription
height (required)NumberThe window's new height

Example:

Copy
Did this help?