Integration runtime
Extend GitBook with custom components, event handling, OAuth flows, and HTTP
createIntegration
createIntegrationexport default createIntegration({
fetch: async (request, context) => {
// Process an HTTP request.
return new Response(JSON.stringify({ message: "Hello World" }), {
headers: { "Content-Type": "application/json" }
});
},
components: [
// A named component created using createComponent().
myComponent
],
events: {
space_view: async (event, context) => {
console.log("Space viewed:", event);
},
},
});Key
Type
Description
createComponent
createComponentKey
Type
Description
createOAuthHandler
createOAuthHandlerParameter
Type
Description
Example Value
Rendering components
Environment context
API information
Key
Type
Description
Integration information
Key
Type
Description
Site installation (if applicable)
Key
Type
Description
Organization installation (if applicable)
Key
Type
Description
Runtime secrets
Key
Type
Description
Events
Event Name
Description
Actions
HTTP communication
Option
Type
Description
Example Value
Fetch Method Example
Last updated
Was this helpful?