Wix.Dashboard

closeWindow

closeWindow([message])

Closes the modal endpoint.

Parameters:

Name TypeDescription

Example:

getEditorUrl

getEditorUrl(callback)

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 Editor that will open the App Market with your app in pending.

Note:
This is only relevant for apps that have both a Site component and a Dashboard component.

Parameters:

NameTypeDescription

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:

getProducts

getProducts(onSuccess, [onError])

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

Parameters:

NameTypeDescription

Example:

getSiteViewUrl

getSiteViewUrl(onSuccess)

Retrieves the live site’s base URL.

Parameters:

NameTypeDescription

Value passed to callback:

An object with the base URL of the live site. For example:

{base : “http://www.wix.com”}

Example:

openBillingPage

openBillingPage( )

Allows the app to open the Wix billing page.

Example:

openMediaDialog

openMediaDialog(mediaType, multiSelect, onSuccess, [onCancel])

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.

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.

Parameters:

NameTypeDescription

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:

openModal

openModal(url, width, height, [onClose], [theme])

Opens a lightbox-style modal window over your app in the Wix Dashboard. You can only open this modal from the Wix 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.

Parameters:

NameTypeDescription

Example:

pushState

pushState(state)

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.

Parameters:

NameTypeDescription

Example:

revalidateSession

revalidateSession(onSuccess, [onFailure])

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

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

Parameters:

NameTypeDescription

Example:

Deprecated

setHeight (height)

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

Parameters:

NameTypeDescription

Example:

Was this page helpful?

What can we do to improve it?

What did you like about it?