---
title: "Salaries"
label: "Salaries"
description: "Build indexable salary hubs and title, skill, company, and location detail pages."
publishedAt: 2026-07-10
updatedAt: 2026-10-20
order: 3
status: "published"
---

Build salary pages from Cavuno’s aggregate read models. Salary data is organized by title, skill, company, and location, with cross-axis methods for combinations such as a title in a location.

## Prerequisites

- A shared public `board` client.
- Routes under `/salaries` that use the SDK path helpers.
- Enough real salary observations to make each page useful. There is no `features.salaries` flag; empty data is the gate.

## Load the salary hubs

```ts
// src/data/salaries.ts
import {
  salaryLocationPath,
  salarySkillPath,
  salaryTitlePath,
} from '@cavuno/board/paths';

import { board } from '../lib/board';

export async function loadSalaryHubs() {
  const { language } = await board.context();
  const [companies, titles, skills, locations] = await Promise.all([
    board.salaries.companies.list(),
    board.salaries.titles.list({ locale: language }),
    board.salaries.skills.list({ locale: language }),
    board.salaries.locations.list({ locale: language }),
  ]);

  return {
    companies: companies.data,
    titles: titles.data.map((item) => ({
      ...item,
      path: salaryTitlePath(item.slug),
    })),
    skills: skills.data.map((item) => ({
      ...item,
      path: salarySkillPath(item.slug),
    })),
    locations: locations.data.map((item) => ({
      ...item,
      path: salaryLocationPath(item.placeSlug),
    })),
  };
}
```

Passing `board.context().language` asks the API for board-language names and canonical slugs. Do not translate slugs in the browser.

## Load a canonical detail page

Each detail response includes source and canonical slugs. Redirect when the inbound slug differs from the returned canonical value.

```ts
export async function loadTitleSalary(inboundSlug: string) {
  const { language } = await board.context();
  const detail = await board.salaries.titles.retrieve(inboundSlug, {
    locale: language,
  });

  return {
    detail,
    redirectTo:
      inboundSlug === detail.canonicalSlug
        ? null
        : salaryTitlePath(detail.canonicalSlug),
  };
}
```

The same pattern applies to skills and locations. Use `board.companies.salaries(companySlug)` for a company overview and `.category(companySlug, categorySlug, { locale })` for one company/category combination.

## Set robots on salary pages

Every salary page response has an `indexable` boolean, and so does every item in a salary list, for the page it links to. When it is `false`, render the page with `noindex, follow`: it still renders, and its links stay followable.

```ts
const robots = detail.indexable ? undefined : 'noindex, follow';
```

Hubs such as `/salaries/titles` are judged from their items: index a hub when at least one item it lists is indexable.

```ts
const { data: titles } = await board.salaries.titles.list({ locale: language });
const hubRobots = titles.some((title) => title.indexable)
  ? undefined
  : 'noindex, follow';
```

The board sitemap lists only indexable salary pages, so your robots tags and the sitemap agree.

## Expected result

Hub loaders return only the salary entities Cavuno can support with real aggregates. Detail loaders return localized names, canonical slugs, currency, sample counts, and nullable aggregate sections.

## Verify the result

- Empty hub lists do not produce empty indexable routes.
- Localized pages use the canonical slugs returned by the API.
- A legacy or source-language slug returns a permanent redirect to the canonical page.
- Currency, minimum, maximum, and sample counts come from the response rather than local estimates.

## Errors and edge cases

- Unknown salary slugs can return 404. Convert only that typed error into your framework’s not-found response.
- Some aggregate fields are nullable when the data cannot support a calculation.
- Location indexes are a flattened hierarchy. Rebuild parent/child navigation from `parentSlug` rather than guessing from names.
- Show `placeLabel` wherever you list places. It tells a city from the region it shares a name with (“New York, NY” under “New York”); `placeName` is the bare name.
- Cross-axis pages are intentionally not emitted by the current sitemap walker because the API lacks a bulk pairs endpoint. Keep them discoverable through internal links.

## Production checklist

- Format currencies with the board locale and the returned currency.
- Include visible sample counts so readers understand the strength of an aggregate.
- Render `noindex, follow` wherever `indexable` is `false`, including hubs with no indexable item.
- Add canonical metadata and the appropriate salary JSON-LD helpers from `@cavuno/board/seo`.

Next, add signed-in candidate experiences with [Candidate accounts and talent](/docs/sdk/build-your-board/candidate-accounts-and-talent).
