Skip to content

HostExtensionContext

interface HostExtensionContext

Narrow 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.

Handed to you by the framework; see Host extensions.

http: HttpArc

The HTTP arc: register controllers, middleware, groups, and error handlers.

cfg(...tokens: ConfigToken<unknown>[]): void

Register the config token(s) the extension reads (its flare.json section).

...tokens ConfigToken<unknown>[]

scoped<T extends FlareService>(service: ServiceClass<T>): void

Register a per-request (scoped) service in the DI container.

service ServiceClass<T>

Learn: Host extensions

Last updated: