Skip to main content

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:

  1. A UserSessionStartedEvent object.
    • session: The session started by a user.
  2. A Context object.
note

This is a non-blocking chat function.