Embed the Maison concierge chat widget in an Angular application using a standalone component. ngOnInit handles script injection and ngOnDestroy handles cleanup. Angular official site ↗
Prerequisites
- Angular 14+ (standalone components supported)
- Your Client UUID — find it in the Business Console under Settings
- Browser rendering target (not SSR — see note below)
Steps
Create the MaisonChatComponent
Create
src/app/maison-chat.component.ts. The component is standalone, renders no template, and manages the script tag via the Angular lifecycle.Import and use it in AppComponent
Import
MaisonChatComponentin your rootAppComponentand bind your Client UUID.Build and run your application
Run
ng serveand open your app in the browser. The Maison chat icon should appear in the bottom-right corner within a few seconds.Verify in DevTools
Open your browser DevTools, switch to the Elements tab, and look for
#maison-chat-iconin the DOM. If it's present, the widget initialised correctly.
For the full list of configuration options, control methods, and callbacks, see the Widget SDK Reference.
Common mistakes
initMcbs is not available until the bundle finishes loading. Always place the call inside script.onload.document is not available during server-side rendering. Guard DOM access with an isPlatformBrowser check from @angular/common when running in a Universal context.clientId changes at runtime (uncommon), the component automatically removes the old script and reinjects with the new ID via ngOnChanges.bottom: 20, not bottom: '20px'. Values are plain numbers representing pixels — do not include units.Not sure if it's set up correctly? Use the Site Diagnostic tool.