Overview
Toolkit for building multi-tenant applications with Next.js, Remix, Express, and more
The Nile-JS SDK is a toolkit for building multi-tenant applications with React, Next.js, Remix, Express, and more. The React and web components are documented under components. This reference is for the server-side SDK, which is used to build your server-side application logic.
Installation
Configuration
The SDK is configured using environment variables. You can get these from the Nile Console:
Obtain Database Credentials
- If you haven’t signed up for Nile yet, sign up here and follow the steps to create a database.
- Navigate to Database Settings in your database’s UI at console.thenile.dev.
- Go to Connection settings.
- Select the CLI icon, and click Generate credentials
- Copy the required credentials and store them in an
.env
file so they can be used in the application to connect to the Nile auth service.
Initializing the SDK
The SDK is initialized using the Nile
class. If you initialize the SDK without any arguments, it will use the configuration in the .env
file.
You can also pass in a configuration object to the Nile
constructor to override the configuration in the .env
file.
For more information about the available configuration options, see configuration.
Available Modules
The SDK provides a number of modules with methods for interacting with Nile:
Auth
Securely authenticating users
DB
Tenant-aware querying of your database
Users
Managing users
Tenants
Managing tenants
Routes
Built-in and custom routes
API Reference
The API reference is available in the API Reference section.
Was this page helpful?