Guides
Injecting Runtime Context
Pass application state into local resolution and fallback in a deliberate, inspectable way.
Need the shortest path?
Use Quick Start when you want the smallest working route → scan → graph → run flow first.
Something feels off?
Inspect scan output, graph state, active route/context, and dispatch in a practical order.
Need the full surface?
Browse all runtime methods, hooks, extension points, and lifecycle APIs.
Runtime context is the right place for app state that matters to intent selection but does not belong in semantic tags.
Typical example
ts
4 lines
Cinder.setContextProvider(() => ({
accountId: selectedAccountId,
region: selectedRegion,
}));Async example
ts
5 lines
Cinder.setContextProvider(async () => {
return {
accountId: await getSelectedAccountId(),
};
});Good use cases
- current account or tenant
- selected region
- workflow state
- app-specific environment values
Practical note
Use Cinder.getContext() to inspect what the runtime currently sees.
Related pages
Continue reading