Skip to content

Latest commit

 

History

History
17 lines (12 loc) · 1.33 KB

createintegration.md

File metadata and controls

17 lines (12 loc) · 1.33 KB

createIntegration

The createIntegration() method is the main entry point for your app or integration. It provides the context for GitBook around how your app should look and behave.

The createIntegration() method can take 3 optional arguments, and must be exported from the main script executed in your app's gitbook-manifest.yaml file. See the Configurations section for more info.

ArgumentTypeDescription
fetchfunctionAn async fetch event used to communicate with the GitBook API to make requests.

See the Fetch section to learn more.
componentsarrayThe component(s) to expose in your integration. See the createComponent section for more info.
eventsobjectAn object allowing you to react to GitBook events. See the Events section for more information.

Example

export default createIntegration({
    fetch: async (element, action, context) => {},
    components: [createComponent(options)],
    events: {},
});