HostExtensionContext
interface HostExtensionContextNarrow composition surface handed to a host extension installer. Exactly the application-author capabilities: register services, config, and HTTP routes/middleware.
What it deliberately does NOT expose: lifecycle state, per-context instancing, build/validation ownership, or the test controls. Those are privileged host internals an extension never receives, so an extension physically cannot reach them.
Everything contributed here is compiled into the build exactly like author code (services into the DI graph, middleware/routes into the codegen’d request pipeline); there is deliberately no per-request hook, so an extension can never add uncompiled hot-path cost.
How you get one
Section titled “How you get one”Handed to you by the framework; see Host extensions.
Properties
Section titled “Properties”http: HttpArcThe HTTP arc: register controllers, middleware, groups, and error handlers.
Methods
Section titled “Methods”cfg(...tokens: ConfigToken<unknown>[]): voidRegister the config token(s) the extension reads (its flare.json section).
...tokens ConfigToken<unknown>[]
scoped()
Section titled “scoped()”scoped<T extends FlareService>(service: ServiceClass<T>): voidRegister a per-request (scoped) service in the DI container.
service ServiceClass<T>
Learn: Host extensions