Secret Fingerprint
SecretFingerprint: the masked display of a stored secret, •••• 1a2b in a monospace font, from the few characters your server derives. The mask is hidden from screen readers, which hear "Ending in 1a2b" (labels). It takes only fingerprint, a string or null, so the secret itself never reaches it.
Example
- OpenAI API key
- Ending in x7Qa
- Stripe webhook secret
- Ending in 9f2c
- Legacy token
- No fingerprint
secret-fingerprint-demo.tsxCopy code
Installation
Copy code
Usage
ImportCopy code
Show which secret is stored without showing it: pass the last few characters your server derived. It never takes the value, so it can't leak one.
API reference
SecretFingerprint
| Prop | Type | Default |
|---|---|---|
fingerprintrequiredThe few characters your server derives, like the last four; `null` shows the mask alone. Never the secret. | string | null | – |
labels | Partial<SecretFingerprintLabels> | – |
className | string | – |
Other exports
secretFingerprintLabelstype SecretFingerprintLabelstype SecretFingerprintPropsAccessibility
- The dots are hidden from screen readers, which hear Ending in 1a2b (or No fingerprint) instead.
Agent actions
Plain text: agents read the fingerprint with the page, which is safe since it isn't secret.
Runs agent.snapshot() from @ui-sdk/react/agent on the live preview above.