> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: Introduction - INTERNAL

## Article: Legacy Introduction

## Article Link: https://dev.wix.com/docs/sdk/host-modules/workspace/legacy/introduction-internal.md

## Article Content:

<blockquote class="warning">
  <strong> Do not publish: </strong> This module is only available for app made by Wix and isn't supported for self-managed apps. It's intended for internal Wix platform usage.
</blockquote>

# Legacy API 

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()`](https://dev.wix.com/docs/sdk/host-modules/workspace/legacy/get-context-ids-internal.md): 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.


## Setup

@package_metadata:@wix/admin

To use the Legacy API, install the `@wix/admin` package.

### Install the package

Follow the installation instructions for your development environment.

| Development environment    | Installation method |
| -------------------------- | ------------------- |
| Blocks apps                | Use the [package manager](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/packages/work-with-npm-packages-in-the-editor.md). |
| CLI and self-managed apps   | Run `npm install @wix/admin` or `yarn add @wix/admin`. |

### Usage

To use the Legacy API, you need to:

1. Declare a global type to enable alpha features:

```ts
declare global {
  interface SDKExposureToggle {
    alpha: true;
  }
}
```

2. Import the `legacy` module in your code:

```js
import { legacy } from "@wix/admin";
```

3. Call the module's methods directly. For example:

```js
const contextIds = await legacy.getContextIds();
```

> **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.