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 '@ngaf/chat';
import type { AngularRegistry } from '@ngaf/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?: string

A 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 --ngaf-chat-* tokens such as --ngaf-chat-surface, --ngaf-chat-text, and --ngaf-chat-text-muted to align chat surfaces with your app theme.

#assistantName

assistantName?: string

The display name for wrappers or components that choose to read CHAT_CONFIG.

Default: "Assistant"

Example:

provideChat({ assistantName: 'Code Copilot' });

#renderRegistry

renderRegistry?: AngularRegistry

A 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?: string

A signed license token from threadplane.ai. It is optional in development and should be provided from your production configuration.

Example:

provideChat({ license: environment.ngafLicense });

#Accessing ChatConfig at Runtime

Inject CHAT_CONFIG to read configuration values in your own components:

import { inject } from '@angular/core';
import { CHAT_CONFIG } from '@ngaf/chat';
import type { ChatConfig } from '@ngaf/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 the provideChat() function and CHAT_CONFIG token

The public API exports ChatConfig as a type-only export:

export type { ChatConfig } from './lib/provide-chat';