Skip to content

SiteConfig type is missing the logging, analytics and auth service overrides #293

Description

@arbrandes

Description

initialize() lets a site replace the logging, analytics and auth service implementations through its site config, reading loggingService, analyticsService and authService off getSiteConfig() and falling back to the built-in defaults when they are absent. The SiteConfig type does not know about any of them: OptionalSiteConfig in types.ts stops at segmentKey, so a config that sets one of these fails to compile even though the runtime would honor it.

The effect is that a documented extension point is unreachable from TypeScript. A site wanting its own logging service has to either cast its config or suppress the error, and neither is something we should be asking of it.

The fix is to declare the three properties on OptionalSiteConfig so the type matches what the runtime already accepts. This is a typing correction with no runtime component.

Discovered by an external contributor while configuring a custom logging service.

A fix is proposed in #281.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

Status
In Review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions