*** id: 80050029-f408-4151-9f89-8df161d56d6c title: once slug: /node/reference/pubsub/client/once description: once method for the Client class. max-toc-depth: 3 ---------------- ### once * **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 [Events](/docs/server-sdk/v3/node/reference/pubsub/client/events) for the list of available events. | | `fn` | Function | An event handler. |