Netlify-sdk
migration
byCodemod

Netlify/0.8.1/AddBuildEventHandler

/icons/calendar.svg

Last update

Jul 24, 2024

This codemod renames addBuildHook to addBuildEventHandler as required in Netlify SDK v0.8.1.

Before

import { NetlifyIntegration } from '@netlify/sdk';
const integration = new NetlifyIntegration();
// Adding a build event handler
integration.addBuildHook('onPreBuild', () => {
console.log('This is my first build event handler!');
});

After

import { NetlifyIntegration } from '@netlify/sdk';
const integration = new NetlifyIntegration();
// Adding a build event handler
integration.addBuildEventHandler('onPreBuild', () => {
console.log('This is my first build event handler!');
});

Build custom codemods

Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community

background illustrationGet Started Now