NetlifyIntegration
The NetlifyIntegration
provides different methods to help create your integration.
Usage example
Type parameters
Name | Type |
---|---|
SiteConfigSchema | ZodSchema , undefined |
TeamConfigSchema | ZodSchema , undefined |
BuildContext | ZodSchema , undefined |
BuildConfigSchema | ZodSchema , undefined |
Methods
addApiHandler
addApiHandler(name, func)
Used to add an API handler to the integration.
Parameters
Name | Type |
---|---|
name | string |
func | func |
Returns
void
addBuildEventContext
addBuildEventContext(func)
Used to add a build context to the integration that can be used in a build event handler.
Parameters
Name | Type |
---|---|
handler | func |
Returns
Returns a promise with an object
.
addBuildEventHandler
addBuildEventHandler(type, func)
Used to add a build event handler to the integration.
Parameters
Name | Type |
---|---|
type | BuildHookType , one of the build events |
func | func |
Returns
void
addConnector
addConnector(config)
Used to create a connector for the integration.
Parameters
Name | Type |
---|---|
config | ConnectorConfig |
Returns
addEdgeFunctions (beta)
addEdgeFunctions(path, options)
Used to inform the integration that you want to inject edge functions into the user’s site.
This SDK functionality is currently in beta. The API may change in future releases.
Parameters
Name | Type |
---|---|
path | string |
options | EdgeFunctionsOptions |
Returns
void
addFunctions (beta)
addFunctions(path, options)
Used to inform the integration that you want to inject functions into the user’s site.
This SDK functionality is currently in beta. The API may change in future releases.
Parameters
Name | Type |
---|---|
path | string |
options | FunctionsOptions |
Returns
void
onDisable
onDisable(func)
Used to customize the disablement flow. If your custom handler returns a 200 or 204 status code, the integration will be disabled; otherwise, the integration will be enabled.
Warning: The code defined in the onDisable
method will still complete even if the integration is not disabled. Be sure
the actions you take here are idempotent.
Parameters
Name | Type |
---|---|
func | func |
Returns
void
onEnable
onEnable(func)
Used to customize the enablement flow. The code defined in an onEnable
handler will run after the integration is enabled.
Parameters
Name | Type |
---|---|
func | func |
Returns
void