Content

Help center

Bilingual help articles in categories, public or visible per role, shown as article lists, FAQ accordions or FAQ cards, with onboarding checklists that track what each volunteer has read, from the database or Nuxt Content.

The help center holds articles that explain how things work: how to get to the site, what to do at the bar, what a shift lead expects. Staff write them in both languages under Admin → Help center, file them in categories and decide who may read each one. Anybody reads the public ones at /help. Signed-in volunteers read the rest at /dashboard/help, where onboarding checklists tick off the articles they have read, and a coordinator sees who has not finished.

The package is @frigear-nu/help-center. Who may read a category, an article or a checklist, and who a send reaches, is a grant list (Auth's record audiences); owners follow the volunteering contracts. Every category is of one kind: help (the help center's own articles) or faq (short questions and answers embedded on the site's pages). A category is shown as an accordion, whose articles open in place, or as cards, where each article is a card of its own; the FAQ components show them on any page.

What you get

  • Two areas, one API. A public area (/help) that shows public articles only, the same for every visitor and therefore cacheable and indexable, and a signed-in area (/dashboard/help, an area of the signed-in hub of Dashboard; /account/help without it) with the articles the person is granted, checklists with read state and "recently updated for you". Both paths are options.
  • Articles in categories, in Danish and English, as Markdown (MDC when Nuxt Content is installed). A category carries who may read it; an article can only narrow it.
  • FAQ accordions and cards. A category shown as an accordion lists its articles as questions that open in place; one shown as cards makes each article a card with its own questions and buttons. Both carry FAQPage JSON-LD for search engines. The global Faq, FaqCards, FaqGrid, FaqSectionList and FaqCard components show such categories, or cards written in page frontmatter, in Markdown and on custom pages.
  • Onboarding checklists. A list of articles per everyone or per operation. Opening an article marks it as read. A coordinator reads the progress table.
  • Article sources. The database (edited in admin) and Nuxt Content (files in git), merged by slug, behind one interface that a host can add to.
  • Sending. Links to articles by email and SMS, to the people each article is allowed for.
  • Search over title and text in both languages, shared by every source.
  • Admin area (opt-in, with Admin): articles, categories and checklists in tabs, a checklist page with its progress table, and an FAQ page with the faq categories and their questions. Neither shows the other's records.
  • Account integration: an account menu item and a "Your onboarding" widget on the account overview.
  • A mobile Help tab with Mobile.
  • Composables and helpers: useHelpCenterPaths, useHelpCenterArticles, useHelpCenterSearch, useHelpCenterFaqs, toFaqCardProps, HelpCenterSignedInCta, the path builders helpCenterApi and createHelpCenterPaths, defineHelpCenterSource.
  • Emails. One template, help-center-articles, for Email templates when installed.
ServerClientMobile
Installed for you:Auth, Users, Notify (sending links), UI and Module Kit. You add:@nuxthub/core, and @nuxt/ui for the components and pages. Optional:Admin for the admin pages, Menu for the menu entries, Widget with Account for the onboarding widget, Forms for the FAQ cards' built-in contact button, @nuxt/content for the file source, Mobile for the tab. Articles render through Nuxt Content's <MDC> when your app has it, and as plain text otherwise.

Quick setup

Install the help center

pnpm add @frigear-nu/help-center @nuxthub/core

Add it to nuxt.config.ts

List Admin (and Menu, Account) before the help center, so the pages and the menu entries register. The two areas are on by default; the admin pages are opt-in.

nuxt.config.ts
export default defineNuxtConfig({
  modules: ['@nuxthub/core', '@frigear-nu/admin', '@frigear-nu/help-center'],
  helpCenter: {
    settings: {
      pages: { admin: true },
    },
  },
})

Generate the migration

Without a migration the help_categories, help_articles, help_checklists, help_checklist_items and help_reads tables do not exist, and every request to them fails.
pnpm db:generate

Decide who manages the help center

Staff routes check permissions through Authorization. Without a role that holds help-center:manage, nobody can manage articles. The admin role holds it, and help-center:send and help-center:pii, when your app defines it. Grant them to your own roles by name (authorization.roles.<role>.grant: ['help-center:manage', 'help-center:send']).
nuxt.config.ts
export default defineNuxtConfig({
  authorization: {
    roles: {
      editor: { label: 'Editor', grant: ['help-center:manage'], inherit: ['user'] },
    },
  },
})
What you should see: a signed-in coordinator opens /admin/help-center, adds a category and an article in Danish and English, publishes it and sets the category to public. /help then lists the category to everyone, and a volunteer finds the same article at /dashboard/help.

Options

Options go under the helpCenter key, in settings.

OptionTypeDefaultPurpose
settings.pages.publicstring | false'/help'The public area. false turns it off. Category and article pages follow below it.
settings.pages.signedInstring | false'/dashboard/help'The signed-in area: below the hub of Dashboard when it is installed (/account/help redirects there), else '/account/help'. false turns it off.
settings.pages.adminstring | booleanoffThe staff pages. true is /admin/help-center. Needs Admin.
settings.requiredLocalesstring[]['da', 'en']Languages an article needs in title and body before it can be published.
settings.ctabooleantrueShow HelpCenterSignedInCta. false hides it everywhere the module places it.
settings.accountMenubooleantrueList the signed-in area in the account menu (when it is under /account).
settings.accountWidgetbooleantrueAdd "Your onboarding" to account.overview.
settings.signedInLayoutstringnoneA layout for a signed-in area outside /account and the hub.
settings.signedInMenustring'dashboard' in the hub, else noneThe menu to list a signed-in area outside /account in.
settings.sourcesstring[]['database']The article sources, in merge order. 'content' is added when content.collection is set.
settings.content.collectionstringnoneThe Nuxt Content collection that holds articles. See Nuxt Content.
settings.content.perLocalebooleanfalseOne collection per language (help_da, help_en) instead of a locale field.
settings.content.precedencestring'database'The id of the source (database, content or a registered one) that wins when two articles share a slug. Categories always put the database first.
settings.content.missingLocales'warn' | 'error''warn'What a content article missing a required language does at build time.
settings.mobileTabbooleantrueAdd a Help tab to the mobile app. Needs Mobile.
settings.schemabooleantrueEmit Article JSON-LD for public articles and FAQPage JSON-LD for public accordion and cards categories.
settings.faq.contactComponentstringnoneName of a globally resolvable component an FAQ card renders for its contact. See The contact button.
settings.faq.contactFormstring'contact'Slug of the Forms form the built-in contact button opens.
The resolved paths are in public runtime config, so the mobile app and emails build the same links.

The two areas

Both areas use the same API and the same components; only the reader differs.

AreaDefault pathWho sees what
Public/help, /help/:category, /help/:category/:slugPublic articles only, for every visitor, signed in or not. The page asks for ?public=1, never reads the session, and is identical for everyone, so it caches and indexes the same way.
Signed in/dashboard/help, /dashboard/help/:category, /dashboard/help/:category/:slug (/account/help/... without the hub)Public and restricted articles the person is granted, onboarding checklists with read state, "recently updated for you".
  • Public pages are a site page: UContainer > UPage > UPageHeader, inside the host's layout. A restricted category or article answers "not found" on /help, also to a signed-in person who could read it in the signed-in area.
  • Signed-in pages are app pages: PageHeading, in the hub's dashboard layout (the account layout under /account). Opening an article there (or in the public area, when signed in) marks it as read on the client.
  • The button into the signed-in area. HelpCenterSignedInCta shows signed-in people a "Crew help center" button in the header of /help and at the end of each public article. It renders on the client only, so the public page stays the same for every visitor. Place it anywhere else (site header, footer, account menu) or hide it with cta: false.
  • Accordion categories. A category page shows an accordion category's articles as questions that open in place, in the public area as what visitors may read, in the signed-in area as what the person may read, and a cards category's articles as a grid of cards. See FAQ accordion categories and FAQ cards categories.
  • FAQ components inside an article. In the public area an article's ::faq, ::faq-grid and ::faq-section-list render with public forced on, whoever looks, so /help is the same for every visitor and a signed-in person does not get a restricted question embedded in a public article. In the signed-in area they ask as the person.
  • An article's address is <base>/<its category>/<slug>. A request with another category in the path is redirected (301) to the real one.

Move or turn off an area

nuxt.config.ts
export default defineNuxtConfig({
  helpCenter: {
    settings: {
      pages: {
        public: '/hjaelp', // or false for a host that keeps everything internal
        signedIn: '/crew/help',
      },
      // Outside /account the account layout and menu do not reach: say where it goes.
      signedInLayout: 'crew',
      signedInMenu: 'crew',
    },
  },
})
  • A path starts with /, has no query or hash, is not the site root, and is neither shared by the two areas nor inside the other one (the pages of an outer area would swallow the inner area's); otherwise the build fails with a message naming the option.
  • In the hub (the default with Dashboard) the area is an entry of the hub's dashboard menu (order 40) in its layout, and /account/help (with everything below it) answers with a 302 to the same page under /dashboard/help. The "Your onboarding" widget stays on the account overview.
  • Outside /account the signed-in area gets an authenticated route rule under every locale prefix (guardPages, enforced by Authorization, also on the server) and, with signedInLayout, your layout. It has no account menu item: list it in signedInMenu instead.
  • Under /account the Account module guards and frames it, and the account menu item and the overview widget are on (accountMenu, accountWidget).
  • Links. Every link is built from the configured paths through createHelpCenterPaths (server, emails) or useHelpCenterPaths() (pages, which also keep the locale prefix). No component hard-codes /help.
const paths = useHelpCenterPaths()
paths.public.article('safety', 'first-aid') // '/help/safety/first-aid'
paths.signedIn.index() // '/dashboard/help', or undefined when the area is off

Write articles

An article belongs to one category, has a unique URL name, a title and a body in each language, and starts as a draft. The body is Markdown, MDC when your app has Nuxt Content, so ::faq{category="membership"} works inside it.

Publishing needs text in every language of requiredLocales (da and en by default) in both the title and the body; otherwise the route answers 409 with the code missing_translations, and data.missing lists what is lacking:

{ "missing": [{ "field": "title", "locales": ["da"] }] }

A plain string counts as no language: it is one text for every language, and the rule exists to make sure each language was written on purpose. A published article keeps the rule: an edit that removes a language is refused the same way. The editor shows what an article still lacks while you type. Only published articles reach the public API, whoever asks.

In the admin, Publish in an article's menu stays enabled. On an article that still lacks a language, the item names what is missing and opens the edit slideover with those fields marked; the slideover of a draft has its own Publish article button, enabled once every required language is filled in (it saves, then publishes). A refused publish lists data.missing in its toast.

A reader whose language an article lacks sees it in another one, never blank: the pages show the reader's language, then the site's default locale, then English, then any language the article has. With requiredLocales: ['da'], a Danish article reads in Danish for an English reader.

Help and FAQ categories

A category's kind says what it is for. It is set when the category is created and can be changed later (see Changing the kind). How it is shown (display) is a separate setting, limited to the kind: a help category is a list or an accordion, a faq category cards or an accordion. The category form offers only those, and the API answers 400 validation_failed for any other.

KindWhat it holdsShown as, by defaultWhere it shows
help (the default)The help center's articles.listThe category grid, its own page, article pages, checklists and sends.
faqQuestions and answers embedded on the site's pages (::faq{category}, FaqSectionList and the others).cardsWhere they are embedded, and the FAQ section of the help center's start page. No category or article pages.
  • Two admin pages, never mixed. The help center admin works with help categories and their articles only, the FAQ admin with faq ones only: lists, counts, the category and article forms and their pickers, the checklist and send pickers. Every admin route takes ?kind=help|faq, and the pages pass theirs: a list keeps to that kind, and a record of the other kind is a 404. An article has the kind of its category. A parent must be of the same kind (400), and an FAQ question cannot be on a checklist (400).
  • On /help. The start page lists the help categories, then a Frequently asked questions section with every faq category the reader may read, as questions that open in place. Search finds both kinds; an FAQ hit is labelled FAQ and links to /help?faq=<question>#faq-<category>, which scrolls to the category and opens the question (useHelpCenterPaths().public.faq(category, slug)). The old addresses of an FAQ category or question (/help/<category>, /help/<category>/<question>) answer 301 to that place.
  • Sources. A source's categories are help unless it says otherwise (kind on HelpSourceCategory); a Nuxt Content article is always help. The merged DTOs carry kind on every category and article.

Changing the kind

  • A category. Change to FAQ / Change to help category in a category's row menu, on either admin page, is a PATCH with the other kind. It takes the whole tree along, so a tree never mixes kinds: its subcategories change with it, and their articles follow their categories. A subcategory leaves a parent of the old kind for the top level, unless the same PATCH names a parentId of the new kind. A change to faq removes those articles from every onboarding checklist. The confirm dialog reads GET /api/admin/help-center/categories/:id/kind-change first, and says how many categories and articles move and how many checklist entries are removed.
  • The display changes only when it does not suit the new kind: faq suits cards and accordion, help suits list and accordion. Otherwise it becomes the kind's default (cards, or list). A display in the same PATCH wins, when the new kind offers it.
  • An article. Move to FAQ / Move to help center, in the article editor and its row menu, opens a dialog with the categories of the other kind. It is a PATCH with a categoryId of the other kind. A move to an FAQ takes the article off every checklist, and the dialog warns about this.
  • Old links follow the current kind. A category or question that is now an FAQ answers 301 from its old pages to its place on /help. A question that is a help article again goes from /help?faq=<slug> to its page (301). A category's /help#faq-<category> never reaches the server, so the browser goes on to the category's page.
  • The ?kind= scope of these calls is the kind the record has before the change.

FAQ accordion categories

Short questions and answers, such as "Membership" or "Volunteering", are usually a faq category whose Shown as is Questions (FAQ) (display: 'accordion'); a help category can be shown that way too. Each article is a question: its title is the question, its body the answer. Everything else stays the same: who may read it, drafts and publishing, search, checklists and article pages.

  • On the category page the questions open in place instead of linking to article pages. In the public area the questions are added to the page's FAQPage JSON-LD; the signed-in area has none.
  • An icon and buttons. In an accordion category an article can carry an icon, shown next to the question, and up to ten links ({ label, to, icon? }), shown as buttons under the answer. A button goes to a path on the site, an https:// address, a mailto: or tel: link or an anchor; anything else is a 400. The category's own icon is the card's icon.
  • Order. Order articles in a category's row menu opens a list with a drag handle and up/down buttons. Each move is saved at once through POST /api/admin/help-center/categories/:id/reorder, which takes every article of the category (drafts too) exactly once, or answers 400 invalid_order. Nothing moves while a save runs. The update goes in statements of at most 90 articles (D1's limit of 100 bound parameters), so past 90 articles a failed statement can leave part of the new order.

FAQ cards categories

Shown as Question cards (FAQ) (display: 'cards') makes each article of the category a card of its own, in a grid: the article's title and icon head the card, and its text is split into the parts of the card by three blocks. Everything else is as in an accordion category (grants, drafts, order, search, the FAQPage JSON-LD with the whole text as the answer). The help center admin's article form shows the syntax under the text field of an FAQ category.

article text
Application → General assembly → Review → Reply.

::faq-details{label="More about the process..." icon="i-lucide-check-circle"}
- ✅ Application submitted no later than 10 days before the general assembly.
- ✅ The general assembly is held in Q1. :br The date is published 3 weeks before.
::

::faq-link{label="Become a member" to="/en/membership" icon="i-lucide-user-plus" trailing-icon="i-lucide-arrow-right" variant="subtle" size="lg"}
::

::faq-contact{label="Contact us" :initial='{"subject":"other"}'}
::
PartBecomes
The Markdown outside the blocksThe card's description.
::faq-details{label icon}A question that opens in the card: label is its button, each item of its list a line (no bullets; :br breaks a line).
::faq-link{label to icon trailing-icon variant size color target}A full-width button at the foot of the card, after the questions. The label can also be the block's content.
::faq-contact{label :initial}The card's contact button, with initial (JSON) for the form.

The article's links follow the buttons of its text. Each language has its own text, so labels, paths and icons can differ per language. The text is split with parseMarkdown of @nuxtjs/mdc when the FAQ is fetched (Nuxt Content brings it), so the cards render on the server; without it the whole text is the description. The blocks are global components (FaqDetails, FaqLink, FaqContact) that also render on their own, so the same text reads well on the article's page and in an accordion category: the details as a collapsible, the link as a button.

Show questions in Markdown

The components are global, so a content page uses them in MDC without importing anything. A category is named by its URL name (slug); one the caller may not read, or one that does not exist, renders nothing.

content/en/pages/membership.md
::faq{category="membership"}
::

::faq-grid{categories="membership,volunteering"}
::

::faq-section-list{categories="volunteering"}
::
ComponentTakesRenders
Faqcategory (a slug), contact, publicOne category as a card of questions (a card per article for a cards category).
FaqCardsThe same as FaqGridThe cards alone, without a wrapper, for a grid the parent lays out, such as the #features slot of UPageSection.
FaqGridcategories (slugs, comma separated or an array), items, contact, public, loadingThe cards in a grid.
FaqSectionListThe same as FaqGridA page section's FAQ at the width it gets: one card as its questions at reading width, without a card frame; several in a grid that fills the width (container queries, so it fits an article too).
FaqCardtitle, description, icon, to, faqs, links, contact, publicOne card, from props. Answers render through HelpCenterArticleBody, so with public an FAQ component inside an answer asks as a visitor too.

FaqGrid and FaqSectionList also take inline items (FaqCardProps[]), such as cards kept in a page's frontmatter; the categories come first, then the inline cards. Inline cards are not stored anywhere and have no grants: anything that should be edited by staff, translated in the editor or shown to some people only belongs in a category.

content/en/pages/board.md
::faq-grid{categories="board" :items='meta.cards'}
::
frontmatter
cards:
  - title: Who is on the board?
    icon: i-lucide-info
    faqs:
      - title: Is it paid?
        details: No, the board is 100% volunteer.

Each question opens as a collapsible: the question is the button, the answer a quote below it, and the buttons follow the answer. Every component adds the public questions of its categories to the page's one FAQPage JSON-LD block, listed once however many components show them, with the answers as plain text. settings.schema: false turns it off.

Show questions on a custom page

useHelpCenterFaqs fetches categories with their published articles and text, and toFaqCardProps turns one into the props of FaqCard in the current language.

app/pages/volunteers.vue
<script setup lang="ts">
const { faqs, status } = await useHelpCenterFaqs(['volunteering', 'membership'])
</script>

<template>
  <FaqGrid
    :items="faqs.map(toFaqCardProps)"
    :loading="status === 'pending'"
  />
</template>

useHelpCenterFaqs(categories?, options?) takes a slug, an array of slugs or a comma separated list (none means every faq category the caller may read), and { public?, lazy? }. It returns { faqs, articles, parts, status, error, refresh } (parts: the texts of cards categories split into their cards), built on useAsyncData, so it works with server rendering. Its fetch key includes the signed-in user, so what a restricted category showed to one person is never reused for the next one. With public: true it asks for what visitors read only, and the response is cacheable. Each entry of faqs is a category (HelpFaqDto) with its articles, text included.

The contact button

A card's contact prop ({ label, initial }) adds a button at the bottom of the card. What it opens is decided by the host:

  1. settings.faq.contactComponent: the name of a component the card renders instead, with the card's label and initial. It must be resolvable by name, so register it globally (a component in components/global/, or global: true in addComponent).
  2. Forms installed, no contactComponent: a built-in button opens a modal with the form of settings.faq.contactForm (contact by default). It does not prefill the form; use a contactComponent for that.
  3. Neither: no button.
nuxt.config.ts
export default defineNuxtConfig({
  helpCenter: { settings: { faq: { contactComponent: 'ContactFormModal' } } },
})

Who sees what

Every category, article and checklist stores who may read it as a grant list (grants, Auth's record audiences). Any one grant admits, and an empty list admits nobody: it is never "every signed-in person" (that is a signed-in grant). There is no separate public column: a category is public when it holds a public grant.

GrantWho reads it
{ kind: 'public' }Everyone, without signing in.
{ kind: 'signed-in' }Everyone who is signed in. A send to it reaches nobody: it lists no members.
{ kind: 'role', role }Signed-in people holding that global role (with Authorization).
{ kind: 'team', teamId, minRole }Signed-in people with at least that role on the team, through the team kind's ladder (with Teams).
{ kind: 'team', teamKind, minRole }The same on any team of that kind (with Teams).
{ kind: 'operation', operationId }Signed-in people who take part in the operation (with Operations and crew).
[]Nobody. Staff still see it in the admin area.

A new category starts with []. To show a category to every signed-in person, add a signed-in grant.

A category's grants apply to all its articles, and an article can only narrow them. An article with grants: null inherits its category; an article with a list is read only by people who read the category and match the list. So a public article in a restricted category stays hidden from visitors, and a role-only article in a public category hides from everyone without the role.

Subcategories inherit what their ancestors hide. A category is readable only when it and every category above it are, so a subcategory can narrow its parent and never widen it, and an article inherits the whole chain. That holds in the listings, by an article's address, in search, in checklists, when marking an article as read and when sending links. A public subcategory below a restricted parent is therefore hidden from visitors, and is not public in the DTOs.

  • Through a permission. Every record is read through grantsCanRead(event, 'help-center:read', record): a public grant needs no sign-in, anything else goes through help-center:read and its policy, which evaluates the record's own grants. The answer is cached per record for the request. A send checks each recipient's own grants instead.
  • Checked on write. The body takes the shape of a list; the handler checks it with grantsValidate, so an unknown kind, an invalid grant or an operation or team that does not exist is a 400. A grant that is already stored is not checked again. A stored grant of a kind no installed module knows admits nobody.
  • Owners. A category belongs to the platform (the default) or to an operation or team, checked through Teams' teams:owner:resolve hook.
  • Unreadable is 404, the same answer as for an article that does not exist.

Sources

Articles come from one or more sources behind one interface, so the API, grants, search, checklists and read state work the same for all of them. Sources are merged by slug: the first with a slug wins, and content.precedence puts one first.

type HelpCenterSource = {
  id: string
  readOnly: boolean
  categories(ctx): HelpSourceCategory[] // every category it knows, with whether this reader may read it
  list(ctx): HelpArticleDto[] // published articles the reader may read; ctx has q and category
  get(slug, ctx): HelpArticleDto | undefined
  getById?(id, ctx): HelpArticleDto | undefined // read state and checklists store ids
}
  • database is the tables, edited in admin. A category hidden from the reader still claims its slug, so a category a file source derives cannot take its place. This holds whatever content.precedence says: the precedence decides articles only, and categories always put the database first.
  • A hidden database article does not claim its slug. A draft, or an article the reader may not read, answers nothing for that slug, so another source's article with the same slug is shown to that reader instead. Articles are looked up by id as well: a checklist item or a read of an article that lost a clash still resolves by its own id, but its link uses its slug, which opens the winning article.
  • content is Nuxt Content, below. Its articles are always public.
  • Your own. Define one, register it in a server plugin and list its id:
server/plugins/wiki-source.ts
import { defineHelpCenterSource } from '@frigear-nu/help-center/source'

export default defineNitroPlugin(() => {
  registerHelpCenterSource(defineHelpCenterSource({
    id: 'wiki',
    readOnly: true,
    categories: () => [],
    list: () => [],
    get: () => undefined,
  }))
})
nuxt.config.ts
export default defineNuxtConfig({ helpCenter: { settings: { sources: ['database', 'wiki'] } } })

An article of a restricted database category that a source returns stays reachable by its address, because a source says who may read an article, but the category's listing hides it, so it does not show under the restricted category.

Nuxt Content

Public articles can live as Markdown files in git, reviewed like code. They are always public: Nuxt Content serves every collection to the browser (/__nuxt_content/<collection>/sql_dump.txt), so anything in a collection is effectively public. Restricted articles come only from the database.

content.config.ts
import { defineCollection, defineContentConfig, z } from '@nuxt/content'

export default defineContentConfig({
  collections: {
    help: defineCollection({
      type: 'page', // keeps the default page schema: the article text is read from `rawbody`
      source: { include: 'help/**/*.md', prefix: '/' },
      schema: z.object({
        category: z.string(),
        slug: z.string().optional(),
        order: z.number().optional(),
        checklist: z.union([z.string(), z.array(z.string())]).optional(),
        locale: z.string(),
      }),
    }),
  },
})
nuxt.config.ts
export default defineNuxtConfig({
  modules: ['@nuxt/content', '@nuxthub/core', '@frigear-nu/help-center'],
  helpCenter: { settings: { content: { collection: 'help', precedence: 'database' } } },
})

Collections come from the host's content.config.ts, not from a Nuxt option. Put the same file in each language in a directory named after the language (content/help/da/safety/first-aid.md, content/help/en/safety/first-aid.md), with locale in the frontmatter, or define one collection per language (help_da, help_en) and set content.perLocale.

content/help/da/safety/first-aid.md
---
title: Førstehjælp
locale: da
category: safety
order: 2
checklist: hck_onboarding
---

Ring 112 ved alvorlig skade.
FrontmatterMeaning
titleThe title in that language. Required.
categoryThe URL name of the category. Required. A database category with that slug supplies the title, description, grants and FAQ groups; without one the category is named after its slug.
slugThe URL name. Defaults to the last segment of the path.
orderSort order within the category.
checklistThe id of a checklist (or a list of ids) the article is added to, as a required item.
localeThe language of the file. Required unless perLocale is on.
  • The id of a content article is content:<collection>:<path>, the path without the language directory, so one article in two languages has one id, and help_reads and checklist items can point at it.
  • The build fails on a file that sets visibility, public or grants (content is public), has no category or title, has an unusable slug, or lacks locale when one collection holds every language. It checks the parsed fields, the meta Nuxt Content keeps and the raw frontmatter, so a key the schema drops is still caught. A required language missing from an article is a build warning, or a failure with content.missingLocales: 'error'.
  • In a restricted category. A content article filed under a restricted database category stays public: the category's listing hides it, and it can still be opened by its address. The build cannot warn about the mismatch, because it does not know the database's categories; the admin list shows each article's category, which is where to notice it.
  • Admin shows content articles read-only with a "Source: Nuxt Content" badge. Edit the file instead (admin does not link to it).

Onboarding checklists

A checklist is an ordered list of articles, marked required or optional, for everybody or for one operation.

  • For people. GET /api/help-center/me/checklists returns the checklists a signed-in person may see: their own grants, and, when the checklist has an operationId, taking part in that operation (the operation grant kind; without Operations nobody takes part). Each lists only the articles the person may read (the others are left out, as if not there) with read, readAt and the counts. A checklist with nothing readable is left out. The "Your onboarding" widget and the signed-in home show them.
  • Reading. POST /api/help-center/me/reads with { articleId } marks an article as read, once (the first time is kept). The article must be one the person may read; anything else is the same 404. The article pages call it when a signed-in person opens them. Ids are hlp_... for the database, content:... for Nuxt Content, whatever a custom source uses.
  • The builder. A checklist's page (<admin>/checklists/:id) edits its articles in order, with a required switch. The list is saved as a whole (PATCH with items), and an article that is not found, or listed twice, is a 400.
  • Content files add themselves with the checklist frontmatter, as required items after the builder's.

Who has read what

GET /api/admin/help-center/checklists/:id/progress needs help-center:pii, which no wildcard covers, because which articles a person read is personal data. It lists people with how many required articles they read, the ones who have not finished first, with q over name and email, sorting and pages. A checklist for an operation also lists the people who take part in it (the members of its operation grant), with nothing read yet, which is how a coordinator sees who has not started.

Dashboard item

With Dashboard installed, the same summary is also the item help-center.onboarding of crew.home and the hub's dashboard (permission help-center:read, order 70), next to the account.overview widget, which stays. It shows nothing for people without a checklist. On a dashboard the card has no label of its own (framed): the item's title is its heading. The label is helpCenter.dashboard.onboarding.

Send articles

POST /api/admin/help-center/send (needs help-center:send) sends links by email, SMS or both:

{
  "articleIds": ["hlp_..."],
  "audience": { "grants": [{ "kind": "operation", "operationId": "opr_..." }], "userIds": ["12"] },
  "channels": ["sms"],
  "fallbackToEmail": true,
  "locale": "da"
}
  • Recipients are resolved on the server. userIds are explicit people. grants is a grant list: each kind lists its own members (grantsMembers), in batches under D1's bound parameter limit: role the users Authorization assigned the role to, team the team's members at or above the role, operation the people who take part, plan the people with a membership on the plans. The grants are checked like on write: an unknown kind or a reference that does not exist is a 400, and so is public, which lists nobody. Grants that list nobody are 400 audience_not_resolved, not "sent to nobody". At most 500 people at a time.
  • Nobody gets a link they cannot open. Each recipient's own grants are checked, and the message lists only the articles they may read. A person with none is skipped (no_access).
  • Each person's language. A person gets the message in their own language (users.locale of Users). The send's locale is for people without one, then the first required locale, then English.
  • Links use the configured paths: the public area for a public article, the signed-in area otherwise, with the locale prefix of the person's language when the site uses prefixed routes. The origin is the configured site URL (NUXT_PUBLIC_SITE_URL, through Auth's authSiteOrigin), never a forwarded header the client chose; without one the request's own origin is used under nuxt dev only, and otherwise the send fails with 500 site_url_missing.
  • The email is written in the person's language (da or en; English for any other): the subject of a message with several articles (a single article uses its own title), and the help-center-articles template's subject, heading, greeting and intro props, so with Email templates installed the rendered email is in that language too.
  • Every channel goes through Notify's notifyUser on the help-center.send topic (email and push on by default, SMS offered but off): the email with the help-center-articles template (a fallback body is always there) to the user's own address, and a push notification that names the articles and opens the first one. People choose their channels on the account page of Preferences. Pushes reach phones with Push installed.
  • SMS goes to the user's phone (users.phone of Users) when the sender chose SMS and the person turned on texts for the topic: it is off by default, so a send by SMS reaches only the people who opted in. Nobody is texted without a number. A send by SMS alone has no push.
  • Fall back to email (fallbackToEmail, on by default). A person a text cannot reach (no phone number, or SMS off for them on help-center.send) gets the email instead, with its push; the email still follows their email choice for the topic. Off, they get nothing and are listed as skipped. A text that failed is not retried by email, and a send that already asks for email needs no fallback.

The answer (HelpSendResult) counts the recipients by what they got and lists the ones that got neither an email nor a text, with why:

{
  "recipients": 4,
  "counts": { "sms": 1, "email": 2, "none": 1 },
  "fallback": 2,
  "pushed": 2,
  "skipped": [{ "userId": "17", "name": "Ann", "reason": "opted_out" }]
}
ReasonWhy the person got nothing
unknown_userNo user has the id.
no_accessThey may read none of the articles.
no_phoneA send by SMS without the fallback, and they have no phone number.
no_sms_consentA send by SMS without the fallback, and SMS is off for them on help-center.send (it is off until they turn it on).
no_emailThe email (asked for, or the fallback) had no address.
opted_outThe email (asked for, or the fallback) is off for them on help-center.send.
failedThe channel failed (logged on the server).

The reason is the one of the last channel tried: the email when it was asked for or fallen back to, the text otherwise. Someone who got both a text and an email is counted in sms and email. A push goes with the email and is counted in pushed only.

GET /api/help-center/articles?q= finds published articles whose title or text contains the term in any language, ignoring case, among the ones the caller may read, in every source (50 at most), and ?category= limits it to one category, ?kind= to one kind. Each hit carries kind. The home page of both areas has a search box (useHelpCenterSearch) that labels FAQ hits and links them to the FAQ section.

  • Ignoring case: the term is lowercased in JavaScript, which knows Danish letters; postgresql lowercases the stored text too; sqlite's lower() and LIKE only fold ASCII, so the stored text is compared with the lowercase and the uppercase term.
  • Batched. The grants are not in SQL, so matches are read in batches until there are 50 visible hits or none are left.
  • Once per request. The category tree, each article and each content collection are read once per request, so a send or a checklist evaluates grants per person in memory instead of querying per person.
  • ?public=1 searches what anonymous visitors read.

Limits

Some reads are bounded on purpose. Each cut is logged as a warning.

WhatLimitBeyond it
Public and signed-in article list1000 articlesThe list is cut (a warning is logged).
Search50 hitsThe rest is not returned; narrow the term or the category.
Rows one read scans10 000The read stops (a warning is logged).
Admin article listThe newest 5000 database articles are sorted and paged in memorytotal is counted in SQL and stays accurate, but pages past the cap are empty: search or filter.
One send500 people400: send in parts.

Admin

With Admin installed and pages.admin set:

PagePathWhat staff do
Help center/admin/help-centerThe help categories and articles (?kind=help). Tabs for articles, categories and checklists. Articles: search, filter by status, category and source, add, edit, publish, unpublish, send, delete. Categories: a tree with article counts and how each is shown; order a category's articles.
Checklist/admin/help-center/checklists/:idBuild the checklist and read its progress table.
FAQ/admin/help-center/faqThe faq categories, each with its questions: add, edit, publish, order and delete questions, edit a category, add an FAQ category (shown as cards by default). The same routes and forms as the help center page, scoped with ?kind=faq; its sidebar entry is in the Manage group.
  • Articles open a slideover with the title and body in every language (a Markdown preview), the category, the URL name and who may read it ("Same as the category" or its own list); in an accordion category also its icon and buttons. A new article is a draft; publishing is disabled until every language is filled in (the editor shows what is missing).
  • Categories open a slideover with name, description, parent, how it is shown (an article list, questions or question cards), icon, owner and who may read it (Grants' <GrantsEditor>). A category with articles cannot be deleted; its subcategories move up when it is.
  • Content articles are listed read-only with a source badge.
  • Send opens a slideover to pick articles, people (Users' <UserPicker multiple> on GET /api/admin/help-center/users, with "Create user" for people with users:create), groups (a grant list without public), channels and "Fall back to email". After the send it shows the counts (by SMS, by email, got nothing) and who got nothing with why, and a toast sums it up.
  • Who may read it: Grants' <GrantsEditor>, with every installed grant kind in its "Add" menu. Checklists and sends leave public out.

The sidebar entry (help-center-admin, in admin.nav) shows to people with help-center:manage. Hiding it is not access control: every route checks help-center:manage itself.

Permissions

NameFlagsHeld by defaultWhat it allows
help-center:manageadminCreate and edit categories, articles and checklists, publish and delete.
help-center:sendadminSend article links by email and SMS.
help-center:piisensitiveadminSee who read what, and people's emails in the send form's search. Never covered by a wildcard.
help-center:readimplicitevery signed-in userRead the articles you are granted, and record what you read.
  • Scope: a token may use the named scope help-center or help-center:read itself. A token without it is treated as anonymous on the public routes, and refused me routes (insufficient_scope).
  • Policy on help-center:read. The record (a category, an article or a checklist) is readable when its own grants admit the user; chains are walked one record at a time. Public records need no sign-in.
  • Staff routes check manage (send, pii for those two). A role that holds help-center:* manages and sends, and is still refused the progress table.

Routes

Typed path builders are exported as helpCenterApi from @frigear-nu/help-center/api.

RouteWhoWhat it does
GET /api/help-center/categoriesEveryoneThe categories the caller may read. ?kind=help|faq, ?public=1.
GET /api/help-center/articlesEveryoneThe articles the caller may read, without their text. ?q=, ?category=<slug>, ?kind=help|faq, ?public=1.
GET /api/help-center/articles/:slugEveryoneOne article with its text and category, or 404. ?public=1.
GET /api/help-center/faqsEveryoneCategories with their published articles and text, for the FAQ cards. ?categories=a,b (in that order, any kind; none: every faq category), ?public=1.
GET /api/help-center/me/checklistshelp-center:readThe caller's checklists with read state.
POST /api/help-center/me/readshelp-center:readBody { articleId }: mark a readable article as read.
GET, POST /api/admin/help-center/categorieshelp-center:manageList (an array, with counts; ?kind= for one kind) and create (kind in the body, help by default).
PATCH, DELETE /api/admin/help-center/categories/:idhelp-center:manageEdit (the other kind changes the tree, see Changing the kind); delete (409 category_not_empty while it has articles).
GET /api/admin/help-center/categories/:id/articleshelp-center:manageEvery article of the category, drafts too, in order.
GET /api/admin/help-center/categories/:id/kind-changehelp-center:manageWhat a change to the other kind affects: { kind, categoryCount, articleCount, checklistItemCount, leavesParent }.
POST /api/admin/help-center/categories/:id/reorderhelp-center:manageBody { articleIds }: every article of the category once, in the new order (400 invalid_order otherwise).
GET, POST /api/admin/help-center/articleshelp-center:managePaginated list of every source (q, status, category, source, kind), and add a draft (with ?kind=, its category must be of that kind).
GET, PATCH, DELETE /api/admin/help-center/articles/:idhelp-center:manageRead, edit or delete a database article. GET also reads an article of another source by its id (read-only); such ids can hold a / (content:help:safety/first-aid), and Auth refuses an encoded %2F under /api, so the path builder helpCenterApi.admin.article(id) sends them to /api/admin/help-center/source-articles/<id> with the slashes kept.
POST /api/admin/help-center/articles/:id/publishhelp-center:managePublish. 409 missing_translations when a required language is missing.
POST /api/admin/help-center/articles/:id/unpublishhelp-center:manageBack to a draft.
GET, POST /api/admin/help-center/checklistshelp-center:manageList with items, and create (optionally with items).
GET, PATCH, DELETE /api/admin/help-center/checklists/:idhelp-center:manageRead, edit (items replaces the list) or delete.
GET /api/admin/help-center/checklists/:id/progresshelp-center:piiWho read what, paginated.
POST /api/admin/help-center/sendhelp-center:sendSend article links. Answers the counts and the skipped people with why.
GET /api/admin/help-center/usershelp-center:send?q=: people for the send form's picker (20 at most). With help-center:pii it matches and answers emails too; without, names only.
  • ?kind=help|faq on the admin routes keeps a list to that kind and answers 404 for a category or article of the other kind, read, edited, published, ordered or deleted by id. Without it a route serves both kinds.
  • ?public=1 ignores who asks: it never reads the session, answers the same to everyone, and sets Cache-Control: public, max-age=60, stale-while-revalidate=300. The other answers are private, no-store.
  • Reserved URL names: search, categories, articles, me, new, edit, admin and api.
  • Responses are allowlisted DTOs with ISO dates. The public DTO has no status, grants or audit data; an article says whether it is public, and every category and article its kind. Create and edit take slug, name, description, parentId, owner, grants, kind (an edit to the other kind changes the tree, see Changing the kind), display (list, accordion or cards), icon and sort for a category, and categoryId, slug, title, body, grants (null inherits the category), icon, links and sort for an article. title and body are a string or a { da, en } map; the status has its own routes.
  • Errors use the module toolkit's shape: statusMessage is the message, data.code a stable code (missing_translations, category_not_empty, invalid_order, conflict, not_found, forbidden, insufficient_scope, not_configured).

Database

Tables the module adds. Generate and commit a migration after installing.

TableHolds
help_categorieshlc_ id, a unique slug, Translated name and description, parentId, ownerType and ownerId (platform by default, no id), grants (JSON, [] by default), kind (help by default, or faq; fixed once created), display (list by default, accordion or cards), icon, sort and the dates.
help_articleshlp_ id, categoryId, a unique slug, Translated title and body, searchText and searchBody (title and slug, and body, folded for search), icon, links (JSON buttons), status (draft or published), grants (JSON, null inherits the category), sort, publishedAt, updatedBy and the dates.
help_checklistshck_ id, operationId (none for everybody), Translated name, grants (JSON, [] by default), sort and the dates.
help_checklist_itemshci_ id, checklistId (deleted with it), articleId (a hlp_ id or content:...), sort, required.
help_readshlr_ id, userId, articleId and readAt, unique per person and article.

Translated texts are a string or a { da, en } map. help_articles.categoryId is a restricting foreign key, so a category with articles cannot be deleted. help_checklist_items.articleId and help_reads.articleId are plain text because they also hold ids of other sources.

Translations

Override any string in your app's i18n/locales/<code>.json. The module registers da and en files under helpCenter.*. See overriding module strings. Without @nuxtjs/i18n, the pages use en.

Key groups: menu.*, permissions.*, scopes.*, mobile.*, cta.*, checklist.*, widget.*, category.*, article.*, faq.* and admin.* (with admin.grants*, admin.displays.* and admin.ownerTypes.*).

Mobile

With Mobile installed and the signed-in area on, the module adds a Help tab: the signed-in area's start page with the search, the categories and the onboarding checklist with read state. Turn it off with settings.mobileTab: false.

Next steps

  • Record audiences – the grant lists it stores and sends to.
  • Account – the area the signed-in help center lives in.
Copyright © 2026