Building a profile page
Implement the ProfileProviderService contract and your product appears on every profile.
Every product's presence on a Xeonr profile — the overview card and the
full tab at xeonr.io/@handle/{slug} — is served through one standard
contract: xeonr.profileprovider.v1.ProfileProviderService, defined in
the shared proto.prod.wtf/xeonr/profile-provider module. Your product
implements the service; the profiles service is its only caller. You never
build UI: pages are composed from a fixed vocabulary of layout blocks that
profiles renders in its own design language, for every product alike.
What the platform does for you
The profiles service owns everything around your content:
- Live reads — every render calls your API live, under a short per-call timeout (currently 3.5s); concurrent identical requests are collapsed into one call. Profiles does not cache your responses — what you answer is what renders, so keep these reads fast and cache internally if they're expensive. When a call fails or times out, your product is simply absent from the page for that render.
- Image proxying — send raw upstream artwork URLs; every one is rewritten through the profiles image proxy before a viewer sees it. Hosts must be on the proxy's allowlist — raise that when your CDN is new to the platform.
- Privacy — visibility, widget preferences, and existence-hiding all run profiles-side before your API is called, and again on your output as a backstop.
- Viewer identity — for actions, profiles authenticates the viewer, rate-limits them, and forwards their subject URN on its own service-to-service channel. You never see a viewer token.
The service
service ProfileProviderService {
rpc GetDigest(GetDigestRequest) returns (GetDigestResponse);
rpc GetPage(GetPageRequest) returns (GetPageResponse);
rpc InvokeAction(InvokeActionRequest) returns (InvokeActionResponse);
}GetDigestanswers the compact overview card. It may only carrystat_row,tile_grid,live_nowandtextblocks — anything else is dropped.GetPageanswers the full tab, blocks in render order.paramscarries selector state (see Interactivity).InvokeActionhandles a viewer's button press. Never cached.
Every request names the profile owner's IDP subject URN and carries
hidden_widgets — the widget keys the owner has switched off. Omit those
blocks, and strip gated detail inside other blocks where a key means
more than one whole block (XMB's xmb.devices hides device names inside
its lists, for example). Only you know what your keys mean; profiles can
only drop whole blocks.
Answer PROVIDER_STATUS_NOT_A_USER when the subject has no account or
history in your product. It is a normal answer — never an error — and
keeps "new here" distinct from "product down". It also gates your whole
presence on that profile: a NOT_A_USER answer means your chip, tab and
overview card don't appear at all, and your tab URL answers 404, until
the person first uses your product.
The block vocabulary
Eight kinds, closed on purpose. Every block carries an id (stable,
action-targetable), a widget_key, and optionally a title, mono
subtitle, selector chips and action buttons.
| Kind | Renders as | Use for |
|---|---|---|
stat_row | a band of number tiles | headline figures ("1,284 hours") |
chart | bars or an area series | activity over time, player counts |
tile_grid | artwork grid (poster / wide / square) | top shows, games, screenshots |
list | rows with image, subtitle, time, meta, status dot | recent activity, owned servers, uploads |
live_now | the live strip | what the person is doing right now |
meter_list | proportional meters + label/value facts | genre splits, storage breakdowns |
text | a paragraph | freeform copy |
html | a sandboxed frame | anything the vocabulary can't express |
Formatting rules: pre-format display strings yourself ("42.6h",
"S03E02 · Glass Teeth", "12/32 players") — but send times as
timestamps and progress as position/duration or a start time. Those are
rendered client-side ("2h ago", "LIVE · 2h 13m") so cached responses
never rot.
For live_now, pick the progress shape that matches reality: bounded
(position_ms/duration_ms) for media playback, since for open-ended
sessions, or neither for a plain presence pill.
The HTML escape hatch
html blocks render inside a fully sandboxed iframe on an opaque origin:
no cookies, no parent DOM, and a Content-Security-Policy that blocks any
script you embed. Your markup gets the profile design tokens injected
(--canvas, --surface, --txt, --txt-2, and --accent set to your
product's registered color), links open in new tabs, and the frame
auto-sizes. Treat it as a bridge: when a second product needs the same
shape, it graduates into a real block kind.
Interactivity
Selectors are parameterized re-queries. Declare one on a block —
{"param_id": "window", "options": [{"value": "30d", "label": "30 days"}, …], "selected_value": "30d"}— and the page re-runs GetPage with params: {"window": "1y"} when a
chip is chosen. Ignore unknown keys; default unknown values.
Actions are buttons for signed-in viewers. Declare them on a block
(action_id, label, opaque payload), and handle InvokeAction: the
request carries the profile owner's subject, the authenticated
viewer_subject, your echoed payload, and the current params. Trust
viewer_subject because the bearer is the profiles service account —
treat it as claims-only identity, never resolve tokens for it. Respond
with a message (toasted to the viewer) and/or replace_blocks matched
by block id. Return unimplemented if you have no actions.
Authentication
The profiles service calls you with a service-account bearer carrying
your product's internal scope — by convention {slug}:internal:profiles.
Enforce it in your handler; the shared module deliberately carries no
auth annotations, since every product reads its own. Two setup notes
learned the hard way:
- If your auth interceptor resolves method options from proto
descriptors, the shared module's descriptors carry none of yours —
gate the
xeonr.profileprovider.v1.ProfileProviderServicename explicitly (the caller has no local account in your product). - Register the scope on your application at the IDP and grant it to the profiles service account. Scope grants to service accounts must be application scopes — OIDC scopes are not grantable.
Cache hints
CacheHints.ttl_seconds is accepted but currently ignored — profiles
reads live on every render. Keep returning honest hints anyway (low
~30s while a live_now block is present, higher ~300s otherwise) so
response caching can be re-enabled without a provider change. Your reads
are on every page render now, so cache internally where they're
expensive — the cost is yours.
Hooking it up, end to end
- Implement the service against the shared module's generated SDK
(
proto.prod.wtf/gen/go/xeonr/profile-provider/...), served on your existing API alongside your other Connect services. - Register the internal scope (
{slug}:internal:profiles) on your application at the IDP, and grant it to the profiles service account. - Register the product with the profiles service: an entry in its product registry naming your slug, display name, accent color, and per-environment API and home URLs. Your slug becomes the URL segment, the widget-key prefix, and immutable once live.
- Allowlist your artwork hosts on the profiles image proxy if they are new to the platform.
- Verify on staging: call your service directly with an exchanged
service-account token (scope gate,
NOT_A_USERfor a fresh subject,hidden_widgetshonored), then load a real profile and check the card, the tab, selector round-trips, and that every image URL points at the profiles proxy.
Once the registry entry lands, your tab and overview card appear on the
profile of everyone who has used your product — public by default,
governed by each owner's visibility and widget preferences. Profiles
you answer NOT_A_USER for don't mention your product at all.