# On New Viewer

```lua
function yourEvent(user)
    log(user.displayName .. ' is a new viewer to your channel!');
end

return function()

    addEvent('newViewer', 'yourEvent'); --attaches the event to yourEvent()
    keepAlive();
end
```

{% hint style="info" %}
Events are asynchronous coroutines.
{% endhint %}
