The Legacy API provides methods that you can call to retrieve administrative context information for the current session.
The Legacy API includes the following methods:
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.To use the Legacy API, install the @wix/admin package.
Follow the installation instructions for your development environment.
| Development environment | Installation method |
|---|---|
| Blocks apps | Use the package manager. |
| CLI and self-managed apps | Run npm install @wix/admin or yarn add @wix/admin. |
To use the Legacy API, you need to:
legacy module in your code:Note: This API requires the admin host to be available and properly initialized. Make sure to use an updated version of the host initialization package.