Installation
Complete the following steps as directed to use the project anjum
authentication in your app.
Kindly follow each and every step to setup the authentication.
Configure environment variables
Go to the neon console to get your NEON_KEY
i.e. "connection string" from the project dashboard.
If you want to use the email methods then make sure to also provide the MAIL_USER
and MAIL_PASS
too.
The MAIL_USER
is simply the email address that you want to use to send emails to your users.
To get the MAIL_PASS
follow the following steps.
- Go to your gmail account.
- Tap on profile and click "manage your google account".
- Go to security tab and scroll down to check if you have enabled two factor authentication. (if not then enable it)
- Go to search bar and search for "App passwords".
- click on it and enter your gmail password if prompted.
- Now enter your app name and click "create".
- You'll get the password string on screen.
Remove the extra spaces in the password.
It should look something like this.
Do not change the naming of specified environment variables.
Install package
This will install the necessary files from the npm registry. Depending on the internet connection it'll complete the installation.
Initialize the project
Project anjum requires the configuration with server actions to run.
This command will automatically figure out the project structure and create the necessary files.
Just make sure you have your NEON_KEY
in your env
file.
Also add the MAIL_USER
and MAIL_PASS
if you need email service.
Import methods
Now you are all set to import the methods in both client and server components. Here is an example of how you can import and use the methods in your component.