Skip to main content

Migrating from npm to CLI

Step-by-step guide to migrate from old npm packages to the new CLI-based components.

Why Migrate?

The new CLI approach offers:
  • ✅ Full source code ownership
  • ✅ Unlimited customization
  • ✅ No styleCallbacks complexity
  • ✅ Direct code editing
  • ✅ Better version control
  • ✅ No black-box abstractions

Migration Steps

1

Install CLI Components (Side-by-Side)

First, install the CLI version alongside your existing npm package for testing:
This creates components at src/components/comments-threaded/ without removing your npm package.
2

Update Imports

Change your import statements:Before (npm package):
After (CLI component):
3

Remove styleCallbacks Prop

The CLI components don’t use styleCallbacks. Remove that prop:Before:
After:
4

Apply Customizations in Source Files

Instead of styleCallbacks, edit the source files directly.Example: If you had authorName styling, edit single-comment.tsx:
See Mapping Guide for all callback-to-file mappings.
5

Test Thoroughly

Test the CLI version alongside the npm version to ensure feature parity.
6

Uninstall Old Package

Once you’re confident, uninstall the npm package:

Complete Example

Before (npm package)

After (CLI component)

Then customize by editing source files:

Benefits After Migration


Common Issues

You need to manually apply your styleCallbacks customizations to the source files.Use the Mapping Guide to find where each callback maps to.
If you used Tailwind before but CLI installed inline styles (or vice versa), reconfigure:
The CLI components use the same core SDK (@replyke/react-js). No breaking changes there.Only the component API changed (removed styleCallbacks).

Next Steps

Mapping Guide

Map styleCallbacks to source files

Migration FAQ

Common migration questions

Customization

Customize your new components

Legacy Docs

View old npm package docs