> ## Documentation Index
> Fetch the complete documentation index at: https://hahnbee.mintlify.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Personalization Copy Test

> Repro page for the code-block copy-personalization bug

# Personalization Copy Test

This page exercises personalization placeholders inside code blocks. The bug:
clicking the copy button puts the un-substituted source (e.g. literal
`{user.firstName}`) on the clipboard instead of the rendered value the user
sees on screen.

When logged out, `user` is an empty object — placeholders render as empty
strings. When logged in (via JWT) with `content.firstName` etc. populated,
the rendered text shows real values; copy should match.

**Canary: CANARY-PERSONALIZATION-COPY-01**

## Plain MDX text (control)

This paragraph references the user variable directly in MDX: hello,
{user.firstName}! Your plan is {user.plan} and your API key is {user.apiKey}.

If this paragraph renders the substituted values (or empty strings when logged
out), the MDX runtime is wiring up `user`. If it renders the literal text
`{user.firstName}`, scope is not connecting and the rest of the test won't
diagnose anything useful.

## Standalone code block

```bash Hello theme={null}
echo "Hello {user.firstName}, your plan is {user.plan}"
```

```bash With API key theme={null}
curl https://api.example.com/v1/users \
  -H "Authorization: Bearer {user.apiKey}"
```

## Code group (multiple tabs)

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.example.com/v1/whoami \
    -H "X-User: {user.firstName}" \
    -H "Authorization: Bearer {user.apiKey}"
  ```

  ```js Node theme={null}
  fetch("https://api.example.com/v1/whoami", {
    headers: {
      "X-User": "{user.firstName}",
      Authorization: "Bearer {user.apiKey}",
    },
  });
  ```

  ```python Python theme={null}
  import requests
  requests.get(
      "https://api.example.com/v1/whoami",
      headers={
          "X-User": "{user.firstName}",
          "Authorization": "Bearer {user.apiKey}",
      },
  )
  ```
</CodeGroup>

## Verification

The JWT server (`jwt-server/server.js`) signs tokens with the following
`content` and `apiPlaygroundInputs`:

* `content.firstName = "Jane"`
* `content.company = "Acme Corp"`
* `content.plan = "Enterprise"`
* `content.apiKey = "sk-test-canary-12345"`
* `apiPlaygroundInputs.header.Authorization = "Bearer sk-test-canary-12345"`

After restarting `jwt-server` and logging in via any preset:

1. The control paragraph should read: "hello, Jane! Your plan is Enterprise and
   your API key is sk-test-canary-12345."
2. Click each copy button under "Standalone code block" and paste. Note
   whether the clipboard contains literal `{user.firstName}`/`{user.apiKey}`
   or the substituted values that are visible on screen.
3. If the visible text in the fenced code blocks still reads `{user.x}`
   even when authenticated, MDX is not evaluating expressions inside fences
   and Dean's bug needs the API Playground path instead (separate setup).
