Authentication

Secure identity in minutes — not weeks. Add secure, passwordless login to your application with just a few lines of code.

Overview

CloudIgnite Authentication provides a complete solution for user identity and access management. It is designed to be flexible, secure, and easy to integrate, whether you're building a new application or adding authentication to an existing one. Our library supports JWT-based sessions, OAuth providers, and enterprise-ready features like multi-tenancy.

Installation

To get started, install the CloudIgnite Auth library using your favorite package manager.

npm install @cloudignite/auth

Basic Usage

Initialize the client with your secret key, which can be found in your project settings in the CloudIgnite dashboard. It's recommended to store this key in an environment variable.

import { CloudIgniteAuth } from '@cloudignite/auth';

const auth = new CloudIgniteAuth({
  secretKey: process.env.CLOUDIGNITE_SECRET_KEY,
});

// Create a new user
const user = await auth.users.create({
  email: 'user@example.com',
});

// Generate a sign-in link
const { url } = await auth.signIn.create({
    email: 'user@example.com',
    options: {
        redirectTo: 'http://localhost:3000/welcome',
    },
});

Core Concepts

Users

The User object is the central piece of the authentication system. It contains information about the user such as their email, ID, and any associated metadata.

Sessions

Sessions are managed using JSON Web Tokens (JWTs). Our client libraries handle token refreshing automatically, providing a seamless and secure experience for your users.

Providers

In addition to email-based passwordless login, CloudIgnite supports a variety of OAuth providers, including:

  • Google
  • GitHub
  • Twitter (X)
  • SAML 2.0 (Enterprise)

Enabling a provider is as simple as toggling it on in your dashboard and adding the required client IDs and secrets.