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 privjs.com

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

$ npm config set @module-federation:registry https://r.privjs.com
$ npm config set //r.privjs.com/:_authToken xxxxx-xxxx-xxxx

Replace xxxxx-xxxx-xxxx with the token provided to you by privjs.com. 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 support@privjs.com and we would be happy to help you.