Devcycle To Openfeature Nodejs Update Imports

/icons/badge-info.svg

Made for

Node.js

/icons/calendar.svg

Last update

Mar 13, 2025

DevCycle to OpenFeature Node.js - Update Imports CodeMod

This Codemod helps to convert DevCycle Node.js SDK implementations to the OpenFeature Node.js SDK using the DevCycle Provider. It handles the first step of the conversion by updating the packages imports:

  • Only if the file is using initializeDevCycle, removes the imports of initializeDevCycle, and replaces those imports with DevCycleProvider from @devcycle/nodejs-server-sdk
  • Only if the file is using DevCycleClient, removes the import of DevCycleClient, and replaces those imports with DevCycleProvider from @devcycle/nodejs-server-sdk
  • Replaces DevCycleUser type with EvaluationContext from @openfeature/server-sdk
  • Add imports for OpenFeature from @openfeature/server-sdk if the file is using initializeDevCycle or DevCycleClient

Before

import {
initializeDevCycle,
DevCycleClient,
} from "@devcycle/nodejs-server-sdk";

After

import { DevCycleProvider } from "@devcycle/nodejs-server-sdk";
import { OpenFeature, Client } from "@openfeature/server-sdk";

Build custom codemods

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

background illustrationGet Started Now