Integration runtime
Extend GitBook with custom components, event handling, OAuth flows, and HTTP
Building block
What it does
Create an integration
export 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
Create a component
Key
Type
Description
Create an OAuth handler
Parameter
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
Receiving requests
Field
Type
Description
Sending requests
Option
Type
Description
Example value
Handle a request
Create a request
Return a response
Last updated
Was this helpful?