> ## Documentation Index
> Fetch the complete documentation index at: https://docs.depict.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Set up DPC

> Import and initialise the Depict Performance Client that ships inside @depict-ai/js-ui.

`@depict-ai/js-ui` bundles DPC (Depict Performance Client), so there is nothing extra to install. Import it and initialise it once; the event pages that follow assume `dpc` is initialised.

## Import

Add the import at the top of the file where you initialise DPC:

<CodeGroup>
  ```ts ESM theme={null}
  import { DPC } from "@depict-ai/js-ui";
  ```

  ```ts CommonJS theme={null}
  const { DPC } = require("@depict-ai/js-ui");
  ```
</CodeGroup>

## Initialise

Execute this once in your application, with your merchant id and the market the visitor is browsing:

```ts theme={null}
import { DPC } from "@depict-ai/js-ui";

const dpc = new DPC("merchant_id", { market: "market" })
```

Both values are case-sensitive; merchant ids are always lowercase. Once DPC is initialised, the `dpq` global for sending events imperatively is also available. See the [DPC reference](/reference/performance-client/performance-client) for more information.

### Merchant and market ids

<Note>
  Your **merchant id** is the first path segment after `/v2` in the portal URL:
  when you're logged in at [app.depict.ai](https://app.depict.ai) the address
  looks like `app.depict.ai/v2/your-merchant-id/dashboard`. It's always
  lowercase.
</Note>

<Note>
  Your **market ids** are set up together with your data ingestion and appear
  in the market filters throughout the portal (for example on the Analytics
  page). Use them exactly as written there — they are case-sensitive. If in
  doubt, ask your Depict contact.
</Note>

<Warning>
  **Consent management:** DPC stores a single random visitor identifier in
  `localStorage` under the key `_dep_id` (with a cookie fallback of the same
  name) and starts sending events as soon as it is initialised — it has no
  built-in consent gating. If your consent policy requires it, only initialise
  DPC after the visitor has consented to performance/analytics tracking.
</Warning>
