Checking access…

Skip to main content

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.

Internal content must never be exposed to merchants

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.

BuildACR imageDOCS_AUDIENCEAudience
Merchantdocs-merchantmerchantExternal merchants and partners
Internaldocs-internalinternal (default)Internal team only

Which workflow builds each image, and when:

PipelineMerchantInternalTrigger
Private clusterbuild-merchant-private.ymlbuild-internal-private.ymlPush to main, or manual dispatch
Publicbuild-merchant.ymlbuild-internal.ymlManual 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 areaMerchantInternal
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:

MechanismScopeConfigured in
Audience exclude globsEntire folders β€” never compiledconfig/audience-exclude-globs.js (single source of truth)
<Audience include="internal"> componentInline sections within a pageApplied by authors in MDX source
Single source of truth for folder exclusions

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.exclude
  • scripts/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:

GlobExcluded fromReason
**/05-engineering-guide/**MerchantInternal engineering standards, runbooks, handbook
**/contributing-guide/**MerchantAuthoring and documentation guidelines (docs-site/contributing-guide/)
**/06-high-level-designs/**MerchantArchitecture diagrams and internal design docs
**/announcements/internal/**MerchantInternal announcements
**/announcements/microsite/ops/**MerchantOperational microsite announcements
**/announcements/features/ops/**MerchantOperational feature announcements
**/_drafts/**InternalUnfinished 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>
The <Audience> tag MUST be capitalized

MDX 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 typeExamples
Infrastructure / architecture detailsAKS cluster config, multi-cloud gateway topology, Splunk setup
Internal processing flowsSequence diagrams, wallet merge logic, enterprise settings logic
Internal API endpoints or admin APIs13--Admin.md, internal-only routes
Sensitive error root causesDB errors, upstream dependencies, internal retry logic
Staff-facing notesImplementation notes, known issues not yet customer-visible
Webhook internal mappingInternal event β†’ external event translation tables
HCP-internal URLsHCP 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 /> in Root.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 to docusaurus.config.js)
  • Run yarn build:merchant locally to verify content is stripped correctly