Arbitrum docs portal
Arbitrum documentation portal, on Next.js 16 and Fumadocs. Serves English MDX docs from
OffchainLabs/arbitrum-docs; deployed on Vercel.
This file covers how to work on the docs. For how the codebase works and why, see
INTERNALS.md. Contributing a page or a PR? Start with
CONTRIBUTE.md instead. It covers the frontmatter contract, partials, variables,
moving pages, and the gates to run before you push. For the prose itself, the house editorial
standard is STYLE-GUIDE.md: plain-language rules, words and phrases to replace or
cut, the terminology table, and the glossary-linking convention.
New to Fumadocs, or arriving from the old Docusaurus site? Start with
What Fumadocs is and
Coming from Docusaurus. They take about five minutes and
cover the differences that cause the most mistakes.
Setup
Create your contribution branch from master and open pull requests against master.
pnpm install # runs a postinstall that generates .source/
pnpm dev # install, clean, then http://localhost:3000
The dev server compiles a page when it is first requested, not every page at start. The first
page you open takes a few seconds; the next ones are instant. Two rules follow: no top-level
import or export in a page, and images by URL (/img/…), never a relative path. An edit to a
page shows on the next request. An edit to a partial, or to a {var:…} placeholder's value in
content/vars.json, does not reach a page that is already compiled: save any page under
content/docs/ with a change, or restart pnpm dev. <Var> text in prose updates on its own.
Node 22 (>=22.18 <23) · pnpm 10. Other Node majors are rejected by engines.
Python 3.9 or newer must be available as python3 for pnpm test, which runs the brand-helper
security tests alongside the TypeScript suites. Those Python tests use only the standard library.
pnpm-workspace.yaml sets strictDepBuilds, so an install fails with ERR_PNPM_IGNORED_BUILDS
when a dependency's build script was skipped. Two cases: a node_modules installed before that
setting records the skipped build, so delete node_modules and install again; a new dependency
with a build script needs an entry in ignoredBuiltDependencies or onlyBuiltDependencies in
that file, with a comment saying what its script does. minimumReleaseAge there also refuses a
version published in the last seven days; add it to minimumReleaseAgeExclude to take one on
purpose.
Browse on localhost:3000, not 127.0.0.1. On 127.0.0.1 React does not hydrate and every
component looks broken.
Editor setup
The content rules (pnpm lint, see The content rules) run in the
editor as you type, through ESLint. In VS Code that takes two extensions and one setting:
Install ESLint
(dbaeumer.vscode-eslint) and MDX
(unifiedjs.vscode-mdx). VS Code has no built-in mdx language, so without the second one a
page opens as plain text and ESLint never looks at it.
The ESLint extension validates only JavaScript and TypeScript by default. Add the two content
languages in your user or workspace settings (settings.json):
{
"eslint.validate": ["javascript", "typescript", "mdx", "markdown"]
}
Open the repository root as the workspace folder, so the extension finds eslint.config.ts and
node_modules/eslint, and reload the window after changing settings.
To check it works, paste Text <Callout>Note.</Callout> into any page: the tag gets a
docs/block-component-in-paragraph squiggle within a second. If nothing appears, the Output panel's
ESLint channel says why; "Failed to load the ESLint library" means the folder you opened has no
node_modules. A deprecated eslint.packageManager key in your settings only produces a warning;
delete it.
Other editors with an ESLint integration (JetBrains, Neovim's nvim-lspconfig) work the same
way: enable it for mdx and markdown files.
Search and the AI chat panel are powered by Inkeep. Set the
publishable search key in a local .env (gitignored):
NEXT_PUBLIC_INKEEP_API_KEY=<inkeep-search-key>
Config lives in lib/inkeep.ts; the search dialog mounts in components/inkeep/ and is wired into
RootProvider in app/layout.tsx. The chat panel is in components/ai/; see the two chat rows in
the table below.
Environment variables
None of these are needed to run the site locally; everything that reads them degrades to a no-op
or a documented fallback.
| Variable |
Used by |
Without it |
NEXT_PUBLIC_INKEEP_API_KEY |
search |
search is unavailable |
INKEEP_API_KEY |
/api/chat, the server route behind the AI chat panel |
/api/chat returns 503. With the key set, the route works without the flag: add the WAF rate limit first (INTERNALS.md) |
NEXT_PUBLIC_AI_CHAT_ENABLED |
the AI chat panel in app/(docs)/layout.tsx; routes search's "Ask AI" to the panel |
no panel; true shows it |
NEXT_PUBLIC_SITE_URL |
metadataBase, app/sitemap.ts, app/robots.ts, request tracking |
http://localhost:3000 locally; a production build fails |
NEXT_PUBLIC_POSTHOG_KEY |
page feedback (lib/posthog.ts), web analytics, and request tracking in proxy.ts |
feedback submissions and tracking events are dropped with a server-side log |
NEXT_PUBLIC_VERCEL_ENV |
the production gate on web analytics and the Inkeep event bridge |
neither fires; Vercel sets this one, you never do |
NEXT_PUBLIC_COOKIEYES_ID |
the CookieYes consent banner (components/analytics/cookie-consent.tsx) |
no banner and no HubSpot; PostHog counts every visit cookieless. Scope the production website key to Production and the staging key to Preview and Development |
VERCEL_DEEP_CLONE |
hasFullGitHistory() in source.config.ts, which gates the last-modified dates |
a shallow Vercel clone resolves no dates: no "Last updated" line, no <lastmod>, no article:modified_time, and nothing warns. Set it to true on the Vercel project |
Set the PostHog token the same way as the Inkeep key, in a local .env (gitignored):
NEXT_PUBLIC_POSTHOG_KEY=phc_<posthog-project-token>
NEXT_PUBLIC_POSTHOG_KEY is PostHog's documented name for the publishable phc_ project token
(Project settings, Project API key). It is write-only, so the NEXT_PUBLIC_ prefix is safe even
though two of its three consumers read it on the server. Set it on Vercel for Preview and
Production.
Page feedback needs the key locally. Web analytics and HubSpot do not run locally or on a preview
deployment no matter what you set, because lib/posthog-consent.ts and lib/hubspot.ts also
require NEXT_PUBLIC_VERCEL_ENV to be
production and only Vercel sets that. The CookieYes banner does show wherever
NEXT_PUBLIC_COOKIEYES_ID is set. Request tracking is gated the
same way, on the server-side VERCEL_ENV, so nothing is sent locally or from a preview and no key
is needed for either. See Analytics.
Each tracking event carries a random distinct_id and creates no person profile. The proxy never
reads the reader's IP address. See Routing and proxy.ts.
Before you push
pnpm types:check # the main verification gate
pnpm lint # ESLint over content/: MDX that renders wrong, variables, terms, frontmatter
pnpm test # tooling tests, including the sidebar and redirect checks
pnpm check-links # broken internal links and MDX fragments
pnpm faq:check # the FAQ partials match their Notion snapshots
pnpm format # prettier, in place
CI runs nine blocking checks, then a pnpm build that serves the built site and checks it over
HTTP. pnpm build runs the same formatting and link checks first, so an unformatted file or a
broken link fails the Vercel deploy too. See The gates for the full
list. There is no pre-commit hook, so run these yourself.
types:check checks TypeScript; pnpm lint validates page metadata and MDX shape. Neither
proves the render. Type checking passes on a page that serves literal ::: or
undefined. Always confirm content changes in a browser.
Layout
| Path |
Purpose |
content/docs/ |
MDX pages and the meta.json files that order the sidebar |
content/partials/ |
Reusable _-prefixed fragments, included into pages |
content/glossary/ |
Glossary terms for <Term> (hand-written) |
content/vars.json |
Global variables |
app/(docs)/[...slug]/ |
Docs route |
components/mdx.tsx |
The MDX component registry |
app/preview/ |
Static JSON behind the hover link previews |
components/widgets/ |
The four interactive widgets, each used by one page |
lib/source.ts |
Fumadocs source adapter |
proxy.ts |
Accept: text/markdown negotiation; PostHog fetch tracking |
source.config.ts |
Fumadocs MDX config: the two collections |
lib/page-schema.ts |
The frontmatter schema every page must satisfy |
Write a page
Every page needs a title and a description. A missing one fails pnpm lint (rule
docs/frontmatter-schema) and the build. pnpm types:check does not see frontmatter, so run the
lint before you push.
---
title: 'How to run a full node'
description: One-line summary shown in search results and social cards.
content_type: how-to
author: your-github-handle
sme: reviewing-sme-handle
---
content_type, author, sme, sidebar_label and user_story are optional. When set, content_type must be
one of how-to, concept, quickstart, tutorial, reference, troubleshooting, faq.
The sidebar comes from the meta.json in each directory: a page's directory is its place, and
that file's pages array orders it. sidebar_label replaces the title as the page's sidebar name.
See Place your page in the sidebar and
The sidebar and its roots.
Callouts use Fumadocs' component. Docusaurus ::: directives render as plain text.
<Callout type="warn" title="Before you start">
Fund the batch poster account first.
</Callout>
type is one of info, warn, error, idea or success.
Use a partial
Before writing a banner, note, config table, or troubleshooting block, look in
content/partials/ and reuse a partial instead of duplicating prose. File names say what each
one holds.
<!-- From a doc page: root-anchored, so moving the page never breaks it -->
<include cwd>content/partials/_hardware-requirements.mdx</include>
<!-- From another partial: file-relative -->
<include>../_hardware-requirements.mdx</include>
To add one, create content/partials/<area>/_your-partial.mdx and include it. It needs no
frontmatter. (Details.)
Use a variable
Values that move on a release cadence (version tags, chain parameters, node image names) live in
one file, so you edit them once and every page follows.
The current Nitro release is <Var name="nitroVersionTag" />.
Var