Help center
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/helpwithout 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
accordionlists its articles as questions that open in place; one shown ascardsmakes each article a card with its own questions and buttons. Both carryFAQPageJSON-LD for search engines. The globalFaq,FaqCards,FaqGrid,FaqSectionListandFaqCardcomponents 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
faqcategories 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 buildershelpCenterApiandcreateHelpCenterPaths,defineHelpCenterSource. - Emails. One template,
help-center-articles, for Email templates when installed.
@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.
export default defineNuxtConfig({
modules: ['@nuxthub/core', '@frigear-nu/admin', '@frigear-nu/help-center'],
helpCenter: {
settings: {
pages: { admin: true },
},
},
})
Generate the migration
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
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']).export default defineNuxtConfig({
authorization: {
roles: {
editor: { label: 'Editor', grant: ['help-center:manage'], inherit: ['user'] },
},
},
})
/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.
| Option | Type | Default | Purpose |
|---|---|---|---|
settings.pages.public | string | false | '/help' | The public area. false turns it off. Category and article pages follow below it. |
settings.pages.signedIn | string | 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.admin | string | boolean | off | The staff pages. true is /admin/help-center. Needs Admin. |
settings.requiredLocales | string[] | ['da', 'en'] | Languages an article needs in title and body before it can be published. |
settings.cta | boolean | true | Show HelpCenterSignedInCta. false hides it everywhere the module places it. |
settings.accountMenu | boolean | true | List the signed-in area in the account menu (when it is under /account). |
settings.accountWidget | boolean | true | Add "Your onboarding" to account.overview. |
settings.signedInLayout | string | none | A layout for a signed-in area outside /account and the hub. |
settings.signedInMenu | string | 'dashboard' in the hub, else none | The menu to list a signed-in area outside /account in. |
settings.sources | string[] | ['database'] | The article sources, in merge order. 'content' is added when content.collection is set. |
settings.content.collection | string | none | The Nuxt Content collection that holds articles. See Nuxt Content. |
settings.content.perLocale | boolean | false | One collection per language (help_da, help_en) instead of a locale field. |
settings.content.precedence | string | '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.mobileTab | boolean | true | Add a Help tab to the mobile app. Needs Mobile. |
settings.schema | boolean | true | Emit Article JSON-LD for public articles and FAQPage JSON-LD for public accordion and cards categories. |
settings.faq.contactComponent | string | none | Name of a globally resolvable component an FAQ card renders for its contact. See The contact button. |
settings.faq.contactForm | string | 'contact' | Slug of the Forms form the built-in contact button opens. |
The two areas
Both areas use the same API and the same components; only the reader differs.
| Area | Default path | Who sees what |
|---|---|---|
| Public | /help, /help/:category, /help/:category/:slug | Public 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'sdashboardlayout (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.
HelpCenterSignedInCtashows signed-in people a "Crew help center" button in the header of/helpand 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 withcta: false. - Accordion categories. A category page shows an
accordioncategory'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 acardscategory'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-gridand::faq-section-listrender withpublicforced on, whoever looks, so/helpis 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
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
dashboardmenu (order 40) in its layout, and/account/help(with everything below it) answers with a302to the same page under/dashboard/help. The "Your onboarding" widget stays on the account overview. - Outside
/accountthe signed-in area gets anauthenticatedroute rule under every locale prefix (guardPages, enforced by Authorization, also on the server) and, withsignedInLayout, your layout. It has no account menu item: list it insignedInMenuinstead. - Under
/accountthe 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) oruseHelpCenterPaths()(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.
| Kind | What it holds | Shown as, by default | Where it shows |
|---|---|---|---|
help (the default) | The help center's articles. | list | The category grid, its own page, article pages, checklists and sends. |
faq | Questions and answers embedded on the site's pages (::faq{category}, FaqSectionList and the others). | cards | Where 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
helpcategories and their articles only, the FAQ admin withfaqones 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 a404. 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 thehelpcategories, then a Frequently asked questions section with everyfaqcategory 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>) answer301to that place. - Sources. A source's categories are
helpunless it says otherwise (kindonHelpSourceCategory); a Nuxt Content article is alwayshelp. The merged DTOs carrykindon 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
PATCHwith the otherkind. 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 samePATCHnames aparentIdof the new kind. A change tofaqremoves those articles from every onboarding checklist. The confirm dialog readsGET /api/admin/help-center/categories/:id/kind-changefirst, 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:
faqsuitscardsandaccordion,helpsuitslistandaccordion. Otherwise it becomes the kind's default (cards, orlist). Adisplayin the samePATCHwins, 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
PATCHwith acategoryIdof 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
301from 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
FAQPageJSON-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 tenlinks({ label, to, icon? }), shown as buttons under the answer. A button goes to a path on the site, anhttps://address, amailto:ortel:link or an anchor; anything else is a400. The category's owniconis 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 answers400 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.
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"}'}
::
| Part | Becomes |
|---|---|
| The Markdown outside the blocks | The 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.
::faq{category="membership"}
::
::faq-grid{categories="membership,volunteering"}
::
::faq-section-list{categories="volunteering"}
::
| Component | Takes | Renders |
|---|---|---|
Faq | category (a slug), contact, public | One category as a card of questions (a card per article for a cards category). |
FaqCards | The same as FaqGrid | The cards alone, without a wrapper, for a grid the parent lays out, such as the #features slot of UPageSection. |
FaqGrid | categories (slugs, comma separated or an array), items, contact, public, loading | The cards in a grid. |
FaqSectionList | The same as FaqGrid | A 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). |
FaqCard | title, description, icon, to, faqs, links, contact, public | One 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.
::faq-grid{categories="board" :items='meta.cards'}
::
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.
<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:
settings.faq.contactComponent: the name of a component the card renders instead, with the card'slabelandinitial. It must be resolvable by name, so register it globally (a component incomponents/global/, orglobal: trueinaddComponent).- Forms installed, no
contactComponent: a built-in button opens a modal with the form ofsettings.faq.contactForm(contactby default). It does not prefill the form; use acontactComponentfor that. - Neither: no button.
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.
| Grant | Who 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): apublicgrant needs no sign-in, anything else goes throughhelp-center:readand 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 a400. 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:resolvehook. - 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
}
databaseis 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 whatevercontent.precedencesays: 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.
contentis Nuxt Content, below. Its articles are always public.- Your own. Define one, register it in a server plugin and list its id:
import { defineHelpCenterSource } from '@frigear-nu/help-center/source'
export default defineNitroPlugin(() => {
registerHelpCenterSource(defineHelpCenterSource({
id: 'wiki',
readOnly: true,
categories: () => [],
list: () => [],
get: () => undefined,
}))
})
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.
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(),
}),
}),
},
})
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.
---
title: Førstehjælp
locale: da
category: safety
order: 2
checklist: hck_onboarding
---
Ring 112 ved alvorlig skade.
| Frontmatter | Meaning |
|---|---|
title | The title in that language. Required. |
category | The 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. |
slug | The URL name. Defaults to the last segment of the path. |
order | Sort order within the category. |
checklist | The id of a checklist (or a list of ids) the article is added to, as a required item. |
locale | The 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, andhelp_readsand checklist items can point at it. - The build fails on a file that sets
visibility,publicorgrants(content is public), has nocategoryortitle, has an unusableslug, or lackslocalewhen one collection holds every language. It checks the parsed fields, themetaNuxt 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 withcontent.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/checklistsreturns the checklists a signed-in person may see: their owngrants, and, when the checklist has anoperationId, taking part in that operation (theoperationgrant kind; without Operations nobody takes part). Each lists only the articles the person may read (the others are left out, as if not there) withread,readAtand 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/readswith{ 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 same404. The article pages call it when a signed-in person opens them. Ids arehlp_...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 (PATCHwithitems), and an article that is not found, or listed twice, is a400. - Content files add themselves with the
checklistfrontmatter, 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.
userIdsare explicit people.grantsis a grant list: each kind lists its own members (grantsMembers), in batches under D1's bound parameter limit:rolethe users Authorization assigned the role to,teamthe team's members at or above the role,operationthe people who take part,planthe 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 a400, and so ispublic, which lists nobody. Grants that list nobody are400 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.localeof Users). The send'slocaleis 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'sauthSiteOrigin), never a forwarded header the client chose; without one the request's own origin is used undernuxt devonly, and otherwise the send fails with500 site_url_missing. - The email is written in the person's language (
daoren; English for any other): the subject of a message with several articles (a single article uses its own title), and thehelp-center-articlestemplate'ssubject,heading,greetingandintroprops, so with Email templates installed the rendered email is in that language too. - Every channel goes through Notify's
notifyUseron thehelp-center.sendtopic (email and push on by default, SMS offered but off): the email with thehelp-center-articlestemplate (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.phoneof 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 onhelp-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" }]
}
| Reason | Why the person got nothing |
|---|---|
unknown_user | No user has the id. |
no_access | They may read none of the articles. |
no_phone | A send by SMS without the fallback, and they have no phone number. |
no_sms_consent | A 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_email | The email (asked for, or the fallback) had no address. |
opted_out | The email (asked for, or the fallback) is off for them on help-center.send. |
failed | The 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.
Search
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()andLIKEonly 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=1searches what anonymous visitors read.
Limits
Some reads are bounded on purpose. Each cut is logged as a warning.
| What | Limit | Beyond it |
|---|---|---|
| Public and signed-in article list | 1000 articles | The list is cut (a warning is logged). |
| Search | 50 hits | The rest is not returned; narrow the term or the category. |
| Rows one read scans | 10 000 | The read stops (a warning is logged). |
| Admin article list | The newest 5000 database articles are sorted and paged in memory | total is counted in SQL and stays accurate, but pages past the cap are empty: search or filter. |
| One send | 500 people | 400: send in parts. |
Admin
With Admin installed and pages.admin set:
| Page | Path | What staff do |
|---|---|---|
| Help center | /admin/help-center | The 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/:id | Build the checklist and read its progress table. |
| FAQ | /admin/help-center/faq | The 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>onGET /api/admin/help-center/users, with "Create user" for people withusers:create), groups (a grant list withoutpublic), 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 leavepublicout.
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
| Name | Flags | Held by default | What it allows |
|---|---|---|---|
help-center:manage | admin | Create and edit categories, articles and checklists, publish and delete. | |
help-center:send | admin | Send article links by email and SMS. | |
help-center:pii | sensitive | admin | See who read what, and people's emails in the send form's search. Never covered by a wildcard. |
help-center:read | implicit | every signed-in user | Read the articles you are granted, and record what you read. |
- Scope: a token may use the named scope
help-centerorhelp-center:readitself. A token without it is treated as anonymous on the public routes, and refusedmeroutes (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,piifor those two). A role that holdshelp-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.
| Route | Who | What it does |
|---|---|---|
GET /api/help-center/categories | Everyone | The categories the caller may read. ?kind=help|faq, ?public=1. |
GET /api/help-center/articles | Everyone | The articles the caller may read, without their text. ?q=, ?category=<slug>, ?kind=help|faq, ?public=1. |
GET /api/help-center/articles/:slug | Everyone | One article with its text and category, or 404. ?public=1. |
GET /api/help-center/faqs | Everyone | Categories 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/checklists | help-center:read | The caller's checklists with read state. |
POST /api/help-center/me/reads | help-center:read | Body { articleId }: mark a readable article as read. |
GET, POST /api/admin/help-center/categories | help-center:manage | List (an array, with counts; ?kind= for one kind) and create (kind in the body, help by default). |
PATCH, DELETE /api/admin/help-center/categories/:id | help-center:manage | Edit (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/articles | help-center:manage | Every article of the category, drafts too, in order. |
GET /api/admin/help-center/categories/:id/kind-change | help-center:manage | What a change to the other kind affects: { kind, categoryCount, articleCount, checklistItemCount, leavesParent }. |
POST /api/admin/help-center/categories/:id/reorder | help-center:manage | Body { articleIds }: every article of the category once, in the new order (400 invalid_order otherwise). |
GET, POST /api/admin/help-center/articles | help-center:manage | Paginated 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/:id | help-center:manage | Read, 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/publish | help-center:manage | Publish. 409 missing_translations when a required language is missing. |
POST /api/admin/help-center/articles/:id/unpublish | help-center:manage | Back to a draft. |
GET, POST /api/admin/help-center/checklists | help-center:manage | List with items, and create (optionally with items). |
GET, PATCH, DELETE /api/admin/help-center/checklists/:id | help-center:manage | Read, edit (items replaces the list) or delete. |
GET /api/admin/help-center/checklists/:id/progress | help-center:pii | Who read what, paginated. |
POST /api/admin/help-center/send | help-center:send | Send article links. Answers the counts and the skipped people with why. |
GET /api/admin/help-center/users | help-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|faqon the admin routes keeps a list to that kind and answers404for a category or article of the other kind, read, edited, published, ordered or deleted by id. Without it a route serves both kinds.?public=1ignores who asks: it never reads the session, answers the same to everyone, and setsCache-Control: public, max-age=60, stale-while-revalidate=300. The other answers areprivate, no-store.- Reserved URL names:
search,categories,articles,me,new,edit,adminandapi. - 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 itskind. Create and edit takeslug,name,description,parentId,owner,grants,kind(an edit to the other kind changes the tree, see Changing the kind),display(list,accordionorcards),iconandsortfor a category, andcategoryId,slug,title,body,grants(nullinherits the category),icon,linksandsortfor an article.titleandbodyare a string or a{ da, en }map; the status has its own routes. - Errors use the module toolkit's shape:
statusMessageis the message,data.codea 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.
| Table | Holds |
|---|---|
help_categories | hlc_ 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_articles | hlp_ 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_checklists | hck_ id, operationId (none for everybody), Translated name, grants (JSON, [] by default), sort and the dates. |
help_checklist_items | hci_ id, checklistId (deleted with it), articleId (a hlp_ id or content:...), sort, required. |
help_reads | hlr_ 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.