Skip to main content
Version: 8.0.2

Socket Events

triggerClientEvent

Method allowing to trigger a client event.

ParameterTypeDescription
eventNamestringName of the event.
data{[key: string]: any;}) => Promise<void>) / undefinedData content.

Basic Usage

await I.triggerClientEvent(`test-event`, { a: 1, b: `test` });

handleClientEvent

Method allowing to handle a client event.

ParameterTypeDescription
eventNamestringName of the event.
fn(data?: { [key: string]: any;}) => Promise<void>)Data content.

Basic Usage

        await I.handleServerEvent(`test-event`, async (data) => {
console.log(`My message| ${data}`)
i++;
})

triggerServerEvent

Method allowing to trigger a server event.

ParameterTypeDescription
eventNamestringName of the event.
data{[key: string]: any;}) => Promise<void>) / undefinedData content.

Usage Example

await I.triggerServerEvent(`test-event`, [`<= #Message is here !`]);

handleServerEvent

Method allowing to handle a server event.

ParameterTypeDescription
eventNamestringName of the event.
fn(data?: { [key: string]: any;}) => Promise<void>)Data content.

Usage Example

      await I.handleServerEvent(`test-event`, async (data) => {
console.log(`My message| ${data}`)
})