SDK Event Handling

Event Types

The Assisfy SDK emits several event types that allow you to track your agent’s actions and status in real-time. These events are tied directly to the session, so you will use session.on to subscribe to them.

Event Name
Description

started

Session connected successfully.

browser_started

Agent successfully connected to the browser.

action_run

Agent performed an action (e.g., click, scroll, or type).

thoughts_and_memories

Insights into the agent’s decision-making process.

complete

Session ended with a detailed summary.

error

An error occurred during execution.

external_resource_requested

Agent requires external input or admin approval.

Handling External Resource Requests

When the agent requires external input or admin approval (e.g., filling in a form field), the external_resource_requested event is emitted.

session.on('message', (data) => {
    if (data.event === 'external_resource_requested') {
        if (data.data.resource_type === 'admin_permission_request') {
            session.handlePermissionRequest(true);
        }
        if (data.data.resource_type === 'request_user_input') {
            session.handleInput('test');
        }
    }
});

In this example:

  • The agent requests an external resource.

  • Your system captures the event and responds by providing the required input.

Last updated