J

devcycle-to-openfeature-nodejs-user-context-transform

How to Use
Run this codemod on your codebase using one of the following commands

The easiest way to run this codemod without installing anything globally:

Documentation

DevCycle to OpenFeature Node.js - User Context Transform CodeMod

This Codemod updates the DevCycleUser object to an OpenFeature EvaluationContext object:

  • Replace the DevCycleUser object / types with an EvaluationContext
  • Rename the user_id field to targetingKey in the EvaluationContext
  • If the code is using Typescript types where its typed as DevCycleUser, update it to use EvaluationContext from @openfeature/server-sdk.

Before

ts

After

ts

Ready to contribute?

Build your own codemod and share it with the community.