Do not publish: This module is only available for app made by Wix and isn't supported for self-hosted apps. It's intended for internal Wix platform usage.

getContextIds()

Retrieves context identifiers for the current administrative session, including account ID, user ID, site ID, and app ID.

This method provides access to important contextual information that can be used to identify the current session's administrative context within the Wix platform.

Note: This method requires the admin host to be available and properly initialized. Make sure to use an updated version of the host initialization package.

Method Declaration

Copy

Parameters

This method takes no parameters.

Returns

An object containing the context identifiers:

PropertyTypeDescription
accountIdstringThe account identifier for the current session.
userIdstringThe user identifier for the current session.
siteIdstring (optional)The site identifier, if available for the current session.
appIdstring (optional)The app identifier, if available for the current session.

Example

Get context identifiers for the current session:

Copy

Error Handling

The method may throw errors in the following cases:

  • When the admin host is not available on the current host environment
  • When the getContextIds method is not available on the host (requires updated host initialization package)
  • When the method fails to retrieve context information
Did this help?