# Better Auth

Application authentication

- Package: @bijectionhq/better-auth
- Category: Authentication
- Status: Preview
- License: Apache-2.0
- Bijection source (repository access required): https://github.com/bijectionhq/better-auth/tree/7236917e80c65d701019f05766f92feca7eaa806
- Upstream: https://github.com/convex/better-auth/tree/3f41cbcfbdb26141969d31e10a0199988ec3cf37
- Documentation: https://docs.bijection.com/components/using
- Directory: https://bijection.com/components/better-auth

## Get the source

Bijection repository access is required. Request access at https://bijection.com/contact.

```sh
git clone https://github.com/bijectionhq/better-auth.git
cd better-auth
git checkout 7236917e80c65d701019f05766f92feca7eaa806
```

## Before using this component

Read the package README at the recorded revision for setup, dependencies, and API examples. Upstream documentation describes the original package and may differ from the Bijection adaptation. This is a source candidate for evaluation. Catalog inclusion does not establish npm availability or runtime qualification. Check compatibility with your SDK and deployment before adoption. External providers run their own compute.

## Upstream package documentation

Recorded 2026-10-23. This describes @convex-dev/better-auth; check the Bijection adaptation separately.

This component provides an integration layer for using Better Auth with Convex, enabling framework-agnostic authentication across React, Vue, Svelte, Next.js, and other popular frameworks. It handles email/password authentication, OAuth providers (GitHub, Google, Discord, Twitter), and multi-factor authentication while managing sessions and accounts through Convex's database.

### Use cases

- **Building a multi-framework app** where you need consistent authentication across React, Vue, Svelte, or other frontend frameworks using the same Convex backend
- **Adding social login** to your Convex app with support for GitHub, Google, Discord, Twitter, and other OAuth providers without managing provider-specific integration logic
- **Implementing secure user accounts** with email/password authentication, session management, and two-factor authentication using Convex for data persistence
- **Migrating from another auth solution** to Better Auth while keeping your existing Convex database schema and functions intact
- **Building SSR applications** with Next.js, Nuxt, or Astro that need server-side authentication handling integrated with your Convex backend

### How it works

The component acts as a bridge between Better Auth's authentication system and Convex's database and functions. Better Auth handles the authentication logic, session management, and OAuth provider integrations, while the component ensures all user data, sessions, and account information are stored and managed through your Convex backend.

The integration works by configuring Better Auth to use Convex functions for data persistence operations. When users sign up, sign in, or manage their accounts, Better Auth communicates with your Convex functions to store and retrieve user data, maintaining consistency with your existing Convex schema.

For multi-factor authentication and social sign-on, the component leverages Better Auth's built-in providers while ensuring all authentication state flows through Convex. This allows you to use Convex's real-time subscriptions and query capabilities with authenticated user data across any supported framework.

### Upstream README

Use [Better Auth](https://better-auth.com) with
[Convex](https://www.convex.dev).

**Full documentation and guides:
[labs.convex.dev/better-auth](https://labs.convex.dev/better-auth)**

### Framework Agnostic

**Support for popular frameworks.**

Supports popular frameworks, including React, Vue, Svelte, Astro, Solid,
Next.js, Nuxt, Tanstack Start, Hono, and more.

### Authentication

**Email & Password Authentication.**

Built-in support for email and password authentication, with session and account
management features.

### Social Sign-on

**Support multiple OAuth providers.**

Allow users to sign in with their accounts, including GitHub, Google, Discord,
Twitter, and more.

### Two Factor

**Multi Factor Authentication.**

Secure your users accounts with two factor authentication with a few lines of
code.