Embed the TrueAge card
Add the card
- Load the script once on the page.
- Place
<trueage-card>where the card should appear. - Give it a summary from your server (next section).
The real card, large and compact, showing a sandbox participant:
On your site the button opens TrueAge. Here it does nothing.
Technical notes · Add the card
<trueage-card>is a web component, not an iframe. TrueAge pages refuse to be framed, so don't put them in one.- The script is versioned in its path. A breaking change ships under
/rk-widget/v2/;/rk-widget/v1/keeps working.
Try the card
See how the card looks for other participants. Change a value and the card updates.
Give it a summary
Your server fetches the participant's result and puts it on the page. The browser never holds your TrueAge API key, and the card makes no requests of its own. Pass the result as the summary property, or as the summary attribute with the JSON as its value.
Technical notes · Give it a summary
- Your server calls
GET /participants/{rk_participant_id}/readinesswith your API key. A Read-only key is enough. The result is the summary; pass it on unchanged. - Set
summaryagain to update the card. - From the daily status file instead: take the participant's row for one plan.
readiness_statusisstatus;managed_account_enrolledand its date aremanaged_account; the threeincome_columns areprojected_monthly_retirement_income;missing_inputssplit on;. An empty cell isnull. - See Readiness and enrollment for the result's fields.
Attributes and property
| Name | What it does |
|---|---|
summary (property or attribute) | The readiness result for one participant. As a property, an object or its JSON string. As an attribute, JSON. |
details-url | Where the button goes: your own sign-in launch address. |
theme | light, dark or auto. The default is auto. |
size | large or compact. The default is large. Use compact in a header, a sidebar or any space about 340px wide and 90px tall. |
The details button
The button reads "See details in TrueAge" and appears only on a completed summary. It goes to the first of these that exists:
- The
details-urlattribute: your own single sign-on launch, which signs the participant in and lands them in TrueAge. sign_in_urlfrom the summary.- Nothing: the card shows no button.
To start the launch yourself, such as with a form POST, listen for trueage-details and call preventDefault(). Single sign-on explains the launch.
Technical notes · The details button
trueage-detailsfires when the visitor clicks the button, before navigation. It bubbles and is cancelable.event.detail.urlis the address the button would open.- Without
preventDefault(), the link opens as usual, so opening it in a new tab still works.
What the card shows
| Summary | The card shows |
|---|---|
completed | The TrueAge, ahead, on track or behind with the gap, a goal-age axis, income, "Estimate, not a guarantee." with the as-of date, and the button. |
completed with a non-empty missing_inputs | The same card, with an asterisk after the TrueAge and the note "* Estimate — some plan details weren’t provided." under it. |
completed with retirement_status out_of_reach (true_age is null) | "Out of reach" in place of the age, a line saying the savings don't reach the goal at any age the plan runs to, the goal age, income, "Estimate, not a guarantee." and the button. No axis. |
completed with is_retired | Retired, income, "Estimate, not a guarantee." with the date (the label only when income shows) and the button. No goal comparison. |
pending | "Your TrueAge is being calculated". |
failed or not_available (with or without missing_inputs, which lists annual_compensation when pay wasn't sent) | "Your TrueAge isn't available yet". |
| An invalid summary: missing, not an object, an unknown status, or completed without ages and not out of reach | Nothing, and one warning in the browser console. |
The large card adds one line under the status when managed_account.enrolled is true: "Enrolled in the managed account since Mar 2026". It shows nothing when the participant isn't enrolled or the field is absent.
The TrueAge and the income are projections, so every card that shows one says "Estimate, not a guarantee.": beside the date on the large card, on its own line on the compact card.
On your page
- The card lives in a Shadow DOM, so your styles can't break it and its styles don't leak.
- It fills the width you give it, up to 480px, and works from 280px. Style the card from outside only for width and margin.
- It respects
prefers-reduced-motion. The button is a link with a visible focus ring. - If your site sets a Content Security Policy, allow the script host in
script-src.
Technical notes · On your page
- The card makes no network requests and sets no cookies. It holds no personal data of its own.
- Everything it receives is escaped before it is drawn.
Next: Single sign-on