1
Prerequisites
Nile provides a cloud offering to help build multi-tenant apps. You can also get started with Nile’s Docker image
and try Nile locally. Join our discord to give feedback or ask questions about running Nile locally.
- Docker
- Postgres client. We’ll use
psql
in this guide.
2
Run the Docker Container
test
database
and the 00000000-0000-0000-0000-000000000000
user.3
Connecting to the Database
You can use Or, if you are using a different client, you use the following connection details:
psql
with the following connection string:4
Test Nile Auth
Nile Auth service is running and listening on port 3000. We will do a curl to check if you can reach it and if it is returning the right information.
The curl command queries the list of providers. By default, it should only have the email/credential option.Output:
5
Run create-next-app
This guide uses Next.js with App Router, Typescript and Tailwind CSS. If you have a different framework in mind, you can find additional guides under “Frameworks”
in the sidebar. Initialize a new Next.js project with the following command and give it a name:
6
Setup environment
Create a .env file in the next app folder that you just created and paste the values below. This will make the Next app that we just created use the local Nile Postgres and Nile Auth.
7
Install dependencies
8
Your application must expose API routes to handle authentication operations.Create a folder called Create following files handle the calls to your server, as well as expose the
api
under the app
folder and a folder called [...nile]
under it:nile
instance to your application:app/api/[...nile]/nile.ts
app/api/[...nile]/route.ts
9
Use SDK Components
Your application will interact with above authentication routes using SDK components. Replace the boilerplate
app/page.tsx
with the following:/app/page.jsx
10
Run and Log in to your application

