Skip to content

Latest commit

 

History

History
69 lines (39 loc) · 4.59 KB

File metadata and controls

69 lines (39 loc) · 4.59 KB

Event

Events in GitBook occur when specific actions occur in a GitBook Space or environment. Your integration can tap into these events, read information about them, and dispatch actions as they occur.

They are declared within the createIntegration call, and should return async callback functions for the events you would like to listen to.

Example:

export default createIntegration({
    events: {
        space_view: async (event, context) => {
            // Handle event when the space your integration is installed in is viewed
        },
    },
});

Reference

The following events can be read on the event object passed into the arguments of the callback functions run when the event occurs.

installation_setup

Event received when integration has been installed or updated.

KeyDescription
eventIdThe id of the event
typeThe type of event fired
installationIdThe id of the installation event
statusThe status of the installation event

space_installation_setup

Event received when integration has been installed or updated on a space.

KeyDescription
eventIdThe id of the event
typeThe type of event fired
installationIdThe id of the installation event
spaceIdThe id of the space the installation event occured in
statusThe status of the installation event

space_view

Event received when a page has been visited.

KeyDescription
eventIdThe id of the event
typeThe type of event fired
pageId
visitoranonymousId
cookies
userAgent
ip
url
referrer

ui_render

Event generated when rendering a UI

KeyDescription
eventIdThe id of the event
typeThe type of event fired
authuserId
componentId
props
state
context
action

space_content_updated

Event when the primary content of a space has been updated.

KeyDescription
eventIdThe id of the event
typeThe type of event fired

space_visibility_updated

Event when the visibility of the space has been changed.

KeyDescription
eventIdThe id of the event
typeThe type of event fired
visibility
previousVisibility

space_gitsync_completed

Event when a GitSync operation has been completed.

KeyDescription
eventIdThe id of the event
typeThe type of event fired
state
revisionId
commitId

space_gitsync_started

Event when a GitSync operation has been started.

KeyDescription
eventIdThe id of the event
typeThe type of event fired
revisionId
commitId