Internal vs. Merchant Content Guide
This guide covers everything a contributor needs to know about the two-audience build system: what content belongs in each build, how builds are produced, how they are deployed, and how to author content correctly.
The docs-internal image contains engineering guides, architecture diagrams, admin API references, internal error details, and other sensitive operational content. This image must only be deployed to the Test environment (developers.healthsafepay.com). Deploying it to any merchant-accessible URL is a security violation. If you are unsure whether content is safe for merchants, treat it as internal and wrap it accordingly.
1. The Two Buildsβ
The same source produces two distinct container images. DOCS_AUDIENCE is set at yarn build time, so content is permanently baked into each image. There is no runtime flag.
| Build | ACR image | DOCS_AUDIENCE | Audience |
|---|---|---|---|
| Merchant | docs-merchant | merchant | External merchants and partners |
| Internal | docs-internal | internal (default) | Internal team only |
Which workflow builds each image, and when:
| Pipeline | Merchant | Internal | Trigger |
|---|---|---|---|
| Private cluster | build-merchant-private.yml | build-internal-private.yml | Push to main, or manual dispatch |
| Public | build-merchant.yml | build-internal.yml | Manual dispatch only (the push trigger is commented out) |
Pull requests to main run pr-build-check.yml instead. It builds both audiences to catch build errors, pushes no image, and creates no deployment issue. See Documentation Lints Reference for the checks it runs.
What each build containsβ
| Content area | Merchant | Internal |
|---|---|---|
| Integration guides, API request/response schemas | β | β |
| Error codes visible to merchants | β | β |
<Audience include="internal"> inline sections | β stripped | β |
| Folders in Excluded folders | β excluded | β |
_drafts/ folders | β | β excluded |
OpenAPI [Learn More](...) internal links | β stripped | β |
| AI Assistant (ChatBot, AI SearchBox) | β hidden | β |
2. How Deployments Workβ
Each GitHub Environment has a Helm values file that fixes image.repository, so Dev always deploys docs-merchant and Test always deploys docs-internal. The operator only selects the environment; the deploy workflows set only the image tag. Deploying docs-internal to Dev is not possible through the standard workflows.
For the environment mapping, the private and public pipelines, deployment steps, rollback, and troubleshooting, see the Documentation Deployment Runbook.
3. How Content Exclusion Worksβ
Content is excluded from the Merchant build by two mechanisms:
| Mechanism | Scope | Configured in |
|---|---|---|
| Audience exclude globs | Entire folders β never compiled | config/audience-exclude-globs.js (single source of truth) |
<Audience include="internal"> component | Inline sections within a page | Applied by authors in MDX source |
Folder-level exclude globs live in one file: config/audience-exclude-globs.js.
Both consumers import from it, so the site build and the search index stay in sync:
docusaurus.config.jsβpresets β classic β docs.excludescripts/docs/generateSearchPages.jsβ search index generation
To add or remove an excluded folder, edit only config/audience-exclude-globs.js. Do not hardcode globs in the two consumer files.
Excluded folders (entire sections)β
From config/audience-exclude-globs.js, which is the source of truth:
| Glob | Excluded from | Reason |
|---|---|---|
**/05-engineering-guide/** | Merchant | Internal engineering standards, runbooks, handbook |
**/contributing-guide/** | Merchant | Authoring and documentation guidelines (docs-site/contributing-guide/) |
**/06-high-level-designs/** | Merchant | Architecture diagrams and internal design docs |
**/announcements/internal/** | Merchant | Internal announcements |
**/announcements/microsite/ops/** | Merchant | Operational microsite announcements |
**/announcements/features/ops/** | Merchant | Operational feature announcements |
**/_drafts/** | Internal | Unfinished drafts |
Inline internal sectionsβ
Use the <Audience> component to hide specific sections within a page that merchants should not see:
<Audience include="internal">
This content is only visible in the internal docs build.
</Audience>
<Audience> tag MUST be capitalizedMDX v3 treats lowercase <audience> as a plain HTML element β the browser ignores it and renders the children unconditionally. Only a capitalized <Audience> is processed as a React component.
- β
<Audience include="internal">β correct - β
<audience include="internal">β content always visible to everyone
No import needed β The component is globally registered via src/theme/MDXComponents.js.
4. What to Mark as Internalβ
Must be wrapped in <Audience include="internal">β
| Content type | Examples |
|---|---|
| Infrastructure / architecture details | AKS cluster config, multi-cloud gateway topology, Splunk setup |
| Internal processing flows | Sequence diagrams, wallet merge logic, enterprise settings logic |
| Internal API endpoints or admin APIs | 13--Admin.md, internal-only routes |
| Sensitive error root causes | DB errors, upstream dependencies, internal retry logic |
| Staff-facing notes | Implementation notes, known issues not yet customer-visible |
| Webhook internal mapping | Internal event β external event translation tables |
| HCP-internal URLs | HCP API catalog internal links, internal JIRA/Confluence references |
Does NOT need to be wrappedβ
Leave visible in both builds:
- API request/response schemas
- Integration guides and code examples
- Error codes and resolutions visible to merchants
- Supported payment methods and capabilities
- Customisation and theming docs
- Sandbox/staging credential guidance
5. AI Assistantβ
The AI Assistant (ChatBot + SearchBox) is automatically hidden in the Merchant build. No manual wrapping is needed. This includes:
- The floating ChatBot sidebar (
<ChatBot />inRoot.js) - The AI-powered SearchBox in the Navbar
- The "AI Assistant is available!" announcement bar
6. Checklist Before Publishing a New Pageβ
When adding a doc that will appear in both builds:
- Does the page contain infrastructure or architecture internals? β Wrap in
<Audience include="internal"> - Does it have internal-only processing flows or sequence diagrams? β Wrap in
<Audience include="internal"> - Is it an entire internal-only section? β Add the folder to
config/audience-exclude-globs.js(never todocusaurus.config.js) - Run
yarn build:merchantlocally to verify content is stripped correctly