12. Router
context.router is the parsed URL of the current page.
context.router.id
sync· returnsstring | undefined
The primary record ID from a details route such as /offers/12.
const offerID = context.router.id;
const result = await context.sdk.entities.getById({
params: { entitySlug: "offers", recordId: offerID }
});context.router.subId
sync· returnsstring | undefined
The secondary ID on a nested details route such as /offers/12/items/5.
const itemID = context.router.subId;id and subId are undefined on list and dashboard pages. Guard before using them, or use context.event.ID when the process was fired from a table row.
Other keys on context.router are whatever else the page route captured (query-style params included). Log context.router once if you need to see the full shape for a given page.