Nile Auth is a multi-tenant, comprehensive, drop-in, open source authentication service built on Postgres. Designed specifically for multi-tenancy, it provides a complete authentication, user management and tenant management system for B2B apps. With first-class tenant support, beautiful React components, wide variety of social logins, password authentication, email templates, and session-based authentication.
Nile-Auth repo is the authentication service. It works with Nile’s SDK. The SDK contains the React components as well as backend routes and methods.
This is a quick NextJS example, you can find examples for other frameworks in our docs.
npm install @niledatabase/server @niledatabase/react
mkdir -p app/api/[...nile]
Create following files handle the calls to your server, as well as expose the nile
instance to your application:
/api/[...nile]/nile.ts
import { Nile } from "@niledatabase/server"; export const nile = await Nile(); export const { handlers } = nile.api;
/api/[...nile]/route.ts
import { handlers } from "./nile"; export const { POST, GET, DELETE, PUT } = handlers;
);
}” dir=”auto”>
import { SignOutButton, SignUpForm, SignedIn, SignedOut, TenantSelector, UserInfo, } from "@niledatabase/react"; import "@niledatabase/react/styles.css"; export default function SignUpPage() { return ( <div className="flex flex-col items-center justify-center min-h-screen"> <SignedIn className="flex flex-col gap-4"> <UserInfo /> <TenantSelector className="py-6 mb-10" /> <SignOutButton /> SignedIn> <SignedOut> <SignUpForm createTenant /> SignedOut> div> ); }
Nile Auth is purpose-built for multi-tenant apps. Users belong to one or more tenants, and each tenant has its own data. Authenticated users can access data from any tenant they have access to – this access control is enforced at all layers – from the browser to the authentication service to the database itself. All authentication features can be enabled at the application level, or disabled for a specific tenant.
Keep full control of your user data by storing it directly in your own database. At Nile we believe that user information, just like tenant information, is deeply integrated with your application data and best stored in the same database. This provides security, performance and consistency across your entire stack.
Scale your application with confidence, supporting unlimited active users at no additional cost. Some authentication services pricing depends on the number of active users, but at Nile we believe that the number of active users does not accurately reflect the value of the service. We believe that a better metric is database usage (cpu, memory, storage) and the number of enterprise tenants you have (as those are high value customers). Therefore we do not limit the number of active users at any pricing tier, and instead focus on aligning our pricing with your database usage and enterprise adoption.
Access a full suite of authentication features to secure your application thoroughly. Here are some of the features you get out of the box:
- Organization and User management – With flexible React components and APIs. Managed Nile Auth also includes a dashboard for managing users and tenants.
- Multi-tenant authentication – Built-in support for managing multiple tenants effortlessly.
- Multi-framework support – NextJS, Remix, Express, React, etc (Nuxt and Vue coming soon!).
- UI components for embedding in your application – simple, beautiful and flexible
- Single Sign-On (SSO) / Social Login Support: Optional integration with external identity providers using OIDC / OAuth (and soon, SAML)
- Tenant overrides – manage authentication for each tenant individually
- Password Authentication – Supports traditional username/password logins.
- Email Templat