How to install Module-Federation in Nextjs

Cover Image for How to install Module-Federation in Nextjs
Fiona Paul
Fiona Paul

Steps to install module-federation plugin in nextjs

  1. Purchase a license to @module-federation/nextjs-mf library from

  2. Run the following commands in your terminal to configure the license on your machine:

$ npm config set @module-federation:registry
$ npm config set // xxxxx-xxxx-xxxx

Replace xxxxx-xxxx-xxxx with the token provided to you by The token should be sent to you in your email. If you do'nt have a token then you can create a new token by logging into your PrivJs account (link)

  1. Install the package in you project using the following command:
$ npm i @module-federation/nextjs-mf

That's it! If you face any issues, write to us at and we would be happy to help you.