Skip to content

Enablement flow

When a user enables your integration for a team or a site, they authorize the integration to perform Netlify actions on their behalf. This authentication allows the integration to call API handlers and is necessary for things such as installing a build event handler on a site, enabling a connector on a team, configuring environment variables, and interacting with any other Netlify API.

How users enable integrations

When an integration is published, an integration card is added to the Integrations tab in the Netlify UI. The integration card includes an option to Enable the integration. When a user selects Enable, the integration is enabled and authenticated. Users can enable integrations on a team level, site level, or both. Learn more about integration levels.

To check out the integrations that are currently published, log in to Netlify and select Integrations.

Customize the flows

It is possible to customize the enablement and disablement flows to add additional logic. For example, you can add a step to the enablement or disablement flow that interacts with a third-party API.

Customize the enablement flow

To customize the enablement flow, use the onEnable method. This method allows you to add logic that runs after the integration is enabled for a site or team.

src/index.ts
import { NetlifyIntegration } from "@netlify/sdk";
const integration = new NetlifyIntegration();
integration.onEnable(() => {
// ... logic to run after the integration is enabled for a site or team
});

Configure your integration for OAuth

While this document covers the Netlify authentication that occurs when users enable your integration, you also have the option to ask users to authenticate through an OAuth identity provider as part of your integration’s configuration step. This may be necessary if your integration must make authenticated requests to your APIs.

Learn more about how to use OAuth with your integration.

Customize the disablement flow

To customize the disablement flow, use the onDisable method. This method allows you to add logic that runs before the integration is disabled for a site or team. This ordering makes it possible to add a step to the disablement flow that interacts with a third-party API. For example, to add a step that deletes a resource that was created when the integration was enabled.

src/index.ts
import { NetlifyIntegration } from "@netlify/sdk";
const integration = new NetlifyIntegration();
integration.onDisable(() => {
// ... logic to run before the integration is disabled for a site or team
});

Test your integration’s enablement flow

Use the Integration UI preview mode to preview your integration card and test your enablement flow. This preview mode allows you to test your enablement flow without publishing your integration.