*** id: cfeac22a-42c5-45b2-b7d8-e37bd486b48d title: once slug: /js/reference/chat/client/once max-toc-depth: 3 ---------------- * **once**(`event`, `fn`) Attaches an event handler to the specified event. The handler will fire only once. #### Parameters | Name | Type | Description | | :------ | :------- | :------------------------------------------------------------------------------------------------- | | `event` | `string` | Name of the event. See the list of [events](/docs/browser-sdk/v3/js/reference/chat/client/events). | | `fn` | Function | An event handler. |