Next V14 - Next OG Import

This codemod moves transforms imports from next/server to next/og for usage of Dynamic OG Image Generation.

Next.js
jscodeshift
Estimated time saving
~5 minutes/occurrence
Change mode
Autonomous
Applicability criteria

Next.js version higher or equal to 14.

Made by
Vercel
Vercel

Usage →

Codemod CLI:

intalling vs code extension tooltip icon
codemod next/14/next-og-import
copy CLI command icon

Codemod VS Code extension:

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

Description

This codemod moves transforms imports from next/server to next/og for usage of Dynamic OG Image Generation.

Before

import { ImageResponse } from 'next/server';

After

import { ImageResponse } from 'next/og';