> 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

## Article: Introduction

## Article Link: https://dev.wix.com/docs/sdk/site-sdk/pages-and-navigation/pages/introduction.md

## Article Content:

# About the Pages API

The Pages API describes a Wix site's pages. Use it to build navigation, such as a breadcrumb trail, from the pages a Wix user actually has, and to adapt a component to the page it's shown on.

With the Pages API, you can:

- Retrieve every page on the site, with its title, slug, path, parent page, and whether it's a popup.
- Retrieve the page that's currently displayed, and check whether it's a popup.
- Retrieve the main page, which is the page a site visitor reaches at the site root URL.
- Identify the pages that an installed app adds, by the app's ID and the app page ID.

## Before you begin

It's important to note the following points before starting to code:

- The values can change while the page is open, for example when a Wix user edits pages, or moves to a different page, in the editor. Read them while a component renders, so the component updates when they change.

## Use cases

- [Build a breadcrumb trail for the current page](https://dev.wix.com/docs/sdk/site-sdk/pages-and-navigation/pages/sample-flows.md)
- [Adapt a component shown in a popup](https://dev.wix.com/docs/sdk/site-sdk/pages-and-navigation/pages/sample-flows.md)

## Terminology

- **Main page**: The page a visitor reaches at the site root. A Wix user chooses which page this is.
- **Slug**: The page's own segment of its URL, such as `spring` in `collections/spring`. It's unique across the site, but a Wix user can change it.
- **Popup**: A page that opens over the page a visitor is already on, rather than replacing it.
- **App page**: A page that an app installed on the site adds to it, such as the Bookings checkout page. Its app page ID stays the same across sites, even though a Wix user can change the page's path.

## SDK setup

@package_metadata:@wix/site-service-pages

To use the API, install the `@wix/site-service-pages` package:

```bash
npm install @wix/site-service-pages
```

#### Import the package

```ts
import { PagesDefinition } from '@wix/site-service-pages/definition'
```

#### Import types

Import any type shown in these docs from `@wix/site-service-pages/types`:

```ts
import type { <TypeName> } from '@wix/site-service-pages/types'
```

#### Resolve the service

In a React component, resolve the service with the `useService` hook:

```tsx
import { useService } from '@wix/services-manager-react'
import { PagesDefinition } from '@wix/site-service-pages/definition'

function CurrentPageTitle() {
    const pagesService = useService(PagesDefinition)

    return <h1>{pagesService.currentPage.title}</h1>
}
```