User session started
This function is triggered when a user starts a user session. Using this function, you can define custom logic to create channels, setup user state, or hook into your backend.
async function handleEvent(event: UserSessionStartedEvent, context: Context) {
}
The above hook function provides two parameters:
- A
UserSessionStartedEvent
object.session
: The session started by a user.
- A
Context
object.
note
This is a non-blocking chat function.