To add redshield's methods and UI to your app you need to install npm package that'll add the redshield locally to your project. Before installing redshield make sure that
next@14.1.0 or greater is installed in your project. If not simply run following command in your project terminal.
Important note : Redshield won't work on older version of next. minimum requirement is 14.1.0
Now install the redshield npm package by running the following command in your project terminal
After successfully installing it go to
package.json file and look for redshield in dependencies to esnure the installation.
Add environment variables
Now you have to add your API key and JWT secret to your project environment variables. Create a
.env.local file in your project root directory and add the following keys as specified below
RED_KEY=your_project_api_key
JWT_SECRET=your_own_jwt_secret
RED_KEY is the project api key in your redshield project and
JWT_SECRETis the secret used to encode and decode the JWT tokens so it's completely your choice to add whatever seems secure to your project. Its reccomended to use the combinations of letters and numbers for
JWT_SECRET.
Important note : keep the api key and jwt secret confidential.
learn more Note : do not change the naming of environment variables specified.