Netlify-sdk V0.8.4 - addApiHandler

This codemod renames addHandler to addApiHandler as required in Netlify SDK v0.8.1.

Netlify SDK
jscodeshift
Estimated time saving
~1 minutes/occurrence
Change mode
Autonomous
Applicability criteria

Netlify SDK v0.8.1 or higher.

Made by
Codemod.com
Codemod.com

Usage →

Codemod CLI:

intalling vs code extension tooltip icon
codemod netlify/0.8.4/addApiHandler
copy CLI command icon

Codemod VS Code extension:

intalling vs code extension tooltip icon
vs code logo
Run in VS Code

Description

This codemod renames addHandler to addApiHandler as required in Netlify SDK v0.8.1.

Before

import { NetlifyIntegration } from '@netlify/sdk';
const integration = new NetlifyIntegration();
integration.addHandler('some-function', async (event, context) => {});

After

import { NetlifyIntegration } from '@netlify/sdk';
const integration = new NetlifyIntegration();
integration.addApiHandler('some-function', async (event, context) => {});