Checking access…

Skip to main content

Which Product Shows This Page?

Convenient Checkout (CCG) and Optum Wallet are two products on one backend, built from the same docs/ folder. Every page you write needs to answer one question: who should see it?

Before you start
  • Scope: only pages under docs/01-business/ and docs/03-Integration/ are product-scoped. Everything else follows its folder.
  • Capabilities: Optum Wallet's surface is narrower than CCG's. Check CCG and Optum Wallet capability exposure for the supported APIs, session modes and widget flows before deciding which product a page belongs to.

Step 1: Pick your situation​

  • 🀝 Both products need the same page. Go to Task 1
  • 🎯 Only one product needs the page. Go to Task 2
  • 🏷️ Mostly the same, a few parts differ. Go to Task 3
  • πŸ”€ Each product needs its own page at the same URL. Go to Task 4
Task 3 or Task 4?

If about 75% or more of the page stays shared, use Task 3. If less, use Task 4. Two clean pages are easier to maintain than one page full of tags.

Task 1: Both products, unchanged​

You end up with: one page that both products show.

  1. Leave productOnly out of the frontmatter.

That's it. Most pages are in this group.

Task 2: One product only​

You end up with: a page that only one product's site contains.

1. Choose the product​

FrontmatterWho sees the page
productOnly: ccgCCG only
productOnly: optum-walletOptum Wallet only

2. Or lock a whole folder​

In the folder's _category_.json, nest the value under customProps:

{ "label": "Upgrade Your Integration", "customProps": { "productOnly": "ccg" } }

Every file inside inherits it. A file can't override or widen its folder's lock, and scripts/docs/lintProductScope.js fails the build if one tries.

A shared page that links to a ccg page has a dead link in Optum Wallet. Wrap that link in <Product include="ccg"> (see Task 3).

Task 3: Shared page with product-specific parts​

You end up with: one page. CCG-only parts show a "CCG only" label on the CCG site and disappear from Optum Wallet.

Pick the display​

Tagged contentdisplay
πŸ“„ A block (paragraph, table, code sample)omit it
✏️ Inside a sentenceinline
πŸ“‹ An <li> in a listlist-item
πŸ—‚οΈ Cards in a gridtiles

Blocks get a collapsible "CCG only" banner. The other displays show a small label or a badge on each card.

Show a different version to each product​

Put one <Product> for each product next to each other:

<Product include="ccg">Pick any session mode.</Product>
<Product include="optum-wallet">Use `PAYMENT_WITH_WALLET`, the only mode available.</Product>

See plugins/remark-strip-product.js for how the tags are processed.

Task 4: Different pages at the same link​

You end up with: two files that share one URL. Each product's site shows its own.

Use this for a folder's landing page (index.md), because the sidebar category and the product switcher both point at it.

What the folder looks like​

docs/01-business/3-Core-Capabilities/
β”œβ”€β”€ _category_.json ← no productOnly here
β”œβ”€β”€ index.md ← productOnly: ccg
└── optum-wallet-index.md ← productOnly: optum-wallet

1. Mark the CCG page​

docs/01-business/3-Core-Capabilities/index.md
---
slug: /business/core-capabilities
productOnly: ccg
---

2. Add the Optum Wallet page​

Name it optum-wallet- plus the CCG file's name:

docs/01-business/3-Core-Capabilities/optum-wallet-index.md
---
slug: /business/core-capabilities
productOnly: optum-wallet
---

3. Match the slug, position and label​

Use the same slug, sidebar_position and sidebar_label in both files. The same URL lets the product switcher land readers on the equivalent page.

4. Run it​

Run yarn start or yarn build. The generator rebuilds docs-optum-wallet/ itself.

Do and don't​

βœ… Do🚫 Don't
Use the same slug in both filesSet id: in either file
Let the generator copy the filePut productOnly in the folder's _category_.json

Why no id:​

The generator strips the optum-wallet- prefix when it copies the file into docs-optum-wallet/, so optum-wallet-index.md becomes index.md there. That is how the folder's _category_.json link ("link": { "type": "doc", "id": "index" }) finds the Optum Wallet page. If a folder has no Optum Wallet page, Optum Wallet gets an auto-generated index instead.

Existing examples: docs/01-business/, docs/01-business/3-Core-Capabilities/ and docs/03-Integration/4-convenient-checkout-ui/2-widget-capabilities/.

Before you merge​

  • Every page has the scope you intended (none, ccg or optum-wallet).
  • No shared page links to a page the other product doesn't have.
  • Paired pages share a slug, and you did not set id:.
  • yarn lint:docs passes. It checks scope conflicts and CCG-only content leaking into Optum Wallet.
  • You did not edit docs-optum-wallet/.

How it works​

You don't need this to follow the tasks. Read it before changing the build mechanism.

One build, two instances

docs serves CCG and docs-optum-wallet serves Optum Wallet. A navbar switcher moves readers between them. This is separate from the merchant/internal audience split (DOCS_AUDIENCE).

Generated, never edited

scripts/docs/generateOptumWalletContent.js rebuilds docs-optum-wallet/ from productOnly before every build. It's gitignored.

Symlink or copy

Shared pages are symlinked. Pages with <Product> or <Audience> tags, and Optum Wallet-only pages, are copied. A symlink resolves back to docs/, so only CCG's plugins would process the tags and CCG-only content would leak.

  • scripts/docs/lintOptumWalletTagLeaks.js checks for that leak after an Optum Wallet build.
  • Optum Wallet is on by default. ENABLE_OPTUM_WALLET in docusaurus.config.js defaults to true. Set it to false, or pass --disable-optum-wallet to scripts/docs/runAudienceDocusaurus.js, to build without it. It's never registered for a merchant build.