# once()

Subscribes to an [event](https://docs.digitalsamba.com/reference/sdk/events) using a **one-time** callback function. The crucial difference to [on()](https://docs.digitalsamba.com/reference/sdk/methods/on) is that once the callback is invoked , then it won't be invoked anymore.

#### Sample subscription code

<pre class="language-javascript"><code class="lang-javascript"><strong>sambaFrame.once('audioEnabled', (event) => {
</strong>  console.log('This will be printed only once even if user enables audio 5 times');
});
</code></pre>
