Documentation Index Fetch the complete documentation index at: https://developer.suki.ai/llms.txt
Use this file to discover all available pages before exploring further.
Overview
EmitterEvents type represents the events the Web SDK emits to monitor session state and handle responses. The code snippet below shows how to use the EmitterEvents type to create an emitter events object.
Version 2.0.4 of the Suki Web SDK updates the EmitterEvents type. Use these events to track granular details for authentication processes and ambient session lifecycles.
Authentication events
The web SDK supports six new auth events that allow you to monitor registration and token refreshes:
Hide authentication events
Emitted when a user is successfully authenticated
Emitted when a user authentication fails
Emitted when a user is successfully registered
Emitted when a user registration fails
Emitted when a user token is successfully refreshed
Emitted when a user token refresh fails
Ambient events
The web SDK supports five new ambient events that allow you to monitor the ambient session lifecycle: Emitted when a new ambient session is started
Emitted when the ambient session is paused
Emitted when the ambient session is resumed
Emitted when the ambient session is cancelled
Emitted when the ambient session is submitted
These additional events will help you monitor the state of the ambient session and handle responses accordingly.
type EmitterEvents = {
ready : never ;
" init:change " : boolean ;
close : never ;
// login events supported by the Web SDK
" login:success " : never ; // New in v2.0.4
" login:fail " : SukiError ;
" register:success " : never ;
" register:fail " : SukiError ;
" token-refresh:success " : never ;
" token-refresh:fail " : SukiError ;
" ambient:update " : {
ambientId : string ;
isAmbientInProgress : boolean ;
isAmbientPaused : boolean ;
};
// lifecycle events supported by the Web SDK
" ambient:start " : { // New in v2.0.4
ambientId : string ;
},
" ambient:pause " : {
ambientId : string ;
},
" ambient:resume " : {
ambientId : string ;
},
" ambient:cancel " : {
ambientId : string ;
},
" ambient:submit " : {
ambientId : string ;
}
" note-submission:success " : {
noteId : string ;
contents : Array <{ title : string ; content : NoteContent }>;
};
error : SukiError ;
};
See all 38 lines
To identify the SukiError from above events, refer to the error codes section for more information.
Properties
Emitted when ambient session state changes
Emitted when the SDK is closed
Emitted when an error occurs. Refer to the SukiError page for more information. Emitted when initialization state changes
Emitted when a note is successfully submitted
Emitted when the SDK is ready for use