Authentication Settings
Sign-in Methods
Nile auth supports a variety of authentication methods. To manage them, navigate to the “Tenants and Users” page in the Dashboard and select the “Configure” tab.
Email Configuration
If you chose to use email as the authentication method, you’ll likely want to set up email verification. To verify users’ emails, you’ll need a way to send them a verification email and customize your email templates. Nile provides full control over your email templates, allowing you to maintain consistent branding and messaging. You’ll find both the SMTP settings and the email templates in the “Configure” tab, under “Email templates”. As always in Nile, the templates, the variables and the SMTP settings are stored in your database, in theauth
schema.
You can learn more about email verification in the Email Verification guide.
SMTP Settings
Nile Auth supports email providers like SendGrid, Mailgun, and others. You’ll need to sign up for an account with one of these providers and then enter the SMTP URI, including credentials. In addition, you’ll need to set the “Sender” email address to a valid email address in your domain.
Email Templates
Once you’ve set up the SMTP settings, you can customize the email templates. You’ll find two templates in the “Email templates” section:- Email invitation: Sent when a user uses their email address to sign up (whether with magic link, through an invitation or with a password).
- Reset password: Sent when a user requests a password reset.

Social Providers
You can configure social providers in the “Providers” tab. Simply click on the provider you want to configure and you’ll see the provider configuration page. All providers use OAuth, so you’ll need to provide the OAuth client ID and secret, which you will get from the provider when you configure it in their developer console.
Per-Tenant Configuration
In addition to setting up authentication for your application as a whole, you can also configure authentication providers on a per-tenant basis. To do this, navigate to the “Tenants and Users” page in Nile console, select the tenant you want to configure and click on the “Configuration” tab.
Application Configuration
When you use Nile SDK with your application, you’ll need to tell the application where to find the database and the auth service.Environment Variables
You’ll find all the environment variables you need in the Nile Console under the “Settings” tab.
.env
file:
Instantiate the SDK
When using the SDK, you’ll need to instantiate it:.env
file.
However, if you need to, you can pass a configuration object to the NileServer
constructor. Here’s the type definition for the configuration object and the matching environment variables. The debug flag is useful to enable debug logging while developing.
Best Practices
- Always configure SMTP settings with a production-grade email provider to ensure reliable delivery of verification and password reset emails
- Enable only the authentication methods you plan to actively maintain and support.
- Some authentication providers (Notably Google) require approval process, so it is recommended to start setting them up in advance.
- Store environment variables securely and never commit them to version control.
- For multi-tenant applications, review and test authentication settings for key tenants individually.
- Customize email templates to match your brand and provide clear instructions to users.
- Enable debug logging only in development environments - it is not recommended to use it in production for both performance and security reasons.