ChatConfig
ChatConfig is the configuration interface accepted by provideChat(). The object is stored under CHAT_CONFIG for application code that wants shared chat defaults, and provideChat() uses the license token to start the package license check.
Import:
import type { ChatConfig } from '@threadplane/chat';
import type { AngularRegistry } from '@threadplane/render';Interface Definition
interface ChatConfig {
/** Shared render registry for consumers that read CHAT_CONFIG. */
renderRegistry?: AngularRegistry;
/** Shared AI avatar label for consumers that read CHAT_CONFIG (default: "A"). */
avatarLabel?: string;
/** Shared assistant display name for consumers that read CHAT_CONFIG (default: "Assistant"). */
assistantName?: string;
/** Signed license token from threadplane.ai. Optional; omitted in dev. */
license?: string;
}Properties
avatarLabel
avatarLabel?: stringA short string (typically one or two characters) for wrappers or components that choose to read CHAT_CONFIG.
Default: "A"
Example:
provideChat({ avatarLabel: 'AI' });There is no avatar-specific CSS token. Use the shared --tplane-chat-* tokens such as --tplane-chat-surface, --tplane-chat-text, and --tplane-chat-text-muted to align chat surfaces with your app theme.
assistantName
assistantName?: stringThe display name for wrappers or components that choose to read CHAT_CONFIG.
Default: "Assistant"
Example:
provideChat({ assistantName: 'Code Copilot' });renderRegistry
renderRegistry?: AngularRegistryA shared render registry value for consumers that inject CHAT_CONFIG. ChatComponent does not read this value directly; pass a ViewRegistry to the <chat [views]="..."> input for built-in generative UI rendering.
Example:
provideChat({ renderRegistry });license
license?: stringA signed license token from threadplane.ai. It is optional in development and should be provided from your production configuration.
Example:
provideChat({ license: environment.tplaneLicense });Accessing ChatConfig at Runtime
Inject CHAT_CONFIG to read configuration values in your own components:
import { inject } from '@angular/core';
import { CHAT_CONFIG } from '@threadplane/chat';
import type { ChatConfig } from '@threadplane/chat';
@Component({
selector: 'app-chat-header',
template: `
<h2>{{ assistantName }}</h2>
`,
})
export class ChatHeaderComponent {
private config = inject(CHAT_CONFIG, { optional: true });
get assistantName(): string {
return this.config?.assistantName ?? 'Assistant';
}
}Gotcha: Inputs Still Win
provideChat() is not a replacement for component inputs. For generative UI, configure the chat surface directly:
<chat [agent]="agentRef" [views]="views" [store]="store" [handlers]="handlers" />Use CHAT_CONFIG when you are building your own wrappers or want route-level defaults that your code reads explicitly.
Type Location
The canonical ChatConfig interface is defined alongside provideChat():
libs/chat/src/lib/provide-chat.ts-- The canonical definition with JSDoc comments, alongside theprovideChat()function andCHAT_CONFIGtoken
The public API exports ChatConfig as a type-only export:
export type { ChatConfig } from './lib/provide-chat';