# Better Auth Ruby

> The most comprehensive authentication framework for Ruby

## Table of Contents

### Adapters

- [MongoDB](/llms.txt/docs/adapters/mongo.md): Use Better Auth Ruby with MongoDB.
- [MS SQL](/llms.txt/docs/adapters/mssql.md): Use Better Auth Ruby with Microsoft SQL Server.
- [MySQL](/llms.txt/docs/adapters/mysql.md): Use Better Auth Ruby with MySQL.
- [PostgreSQL](/llms.txt/docs/adapters/postgresql.md): Use Better Auth Ruby with PostgreSQL.
- [SQLite](/llms.txt/docs/adapters/sqlite.md): Use Better Auth Ruby with SQLite.

### Ai Resources

- [AI Resources](/llms.txt/docs/ai-resources.md): Ask AI in the docs, LLMs.txt, and Better Auth skills for coding assistants.
- [Skills](/llms.txt/docs/ai-resources/skills.md): Install Better Auth agent skills so your coding assistant follows library conventions and patterns.

### Authentication

- [Apple](/llms.txt/docs/authentication/apple.md): Apple provider setup and usage in Better Auth Ruby.
- [Atlassian](/llms.txt/docs/authentication/atlassian.md): Atlassian provider setup and usage in Better Auth Ruby.
- [Cognito](/llms.txt/docs/authentication/cognito.md): Cognito provider setup and usage in Better Auth Ruby.
- [Discord](/llms.txt/docs/authentication/discord.md): Discord provider setup and usage in Better Auth Ruby.
- [Dropbox](/llms.txt/docs/authentication/dropbox.md): Dropbox provider setup and usage in Better Auth Ruby.
- [Email & Password](/llms.txt/docs/authentication/email-password.md): Email and password authentication in Better Auth Ruby.
- [Facebook](/llms.txt/docs/authentication/facebook.md): Facebook provider setup and usage in Better Auth Ruby.
- [Figma](/llms.txt/docs/authentication/figma.md): Figma provider setup and usage in Better Auth Ruby.
- [GitHub](/llms.txt/docs/authentication/github.md): GitHub provider setup and usage in Better Auth Ruby.
- [GitLab](/llms.txt/docs/authentication/gitlab.md): GitLab provider setup and usage in Better Auth Ruby.
- [Google](/llms.txt/docs/authentication/google.md): Google provider setup and usage in Better Auth Ruby.
- [Hugging Face](/llms.txt/docs/authentication/huggingface.md): Huggingface provider setup and usage in Better Auth Ruby.
- [Kakao](/llms.txt/docs/authentication/kakao.md): Kakao provider setup and usage in Better Auth Ruby.
- [Kick](/llms.txt/docs/authentication/kick.md): Kick provider setup and usage in Better Auth Ruby.
- [LINE](/llms.txt/docs/authentication/line.md): LINE provider setup and usage in Better Auth Ruby.
- [Linear](/llms.txt/docs/authentication/linear.md): Linear provider setup and usage in Better Auth Ruby.
- [LinkedIn](/llms.txt/docs/authentication/linkedin.md): Linkedin provider setup and usage in Better Auth Ruby.
- [Microsoft](/llms.txt/docs/authentication/microsoft.md): Microsoft provider setup and usage in Better Auth Ruby.
- [Naver](/llms.txt/docs/authentication/naver.md): Naver provider setup and usage in Better Auth Ruby.
- [Notion](/llms.txt/docs/authentication/notion.md): Notion provider setup and usage in Better Auth Ruby.
- [Other Social Providers](/llms.txt/docs/authentication/other-social-providers.md): Other Social Providers provider setup and usage in Better Auth Ruby.
- [Paybin](/llms.txt/docs/authentication/paybin.md): Paybin provider setup and usage in Better Auth Ruby.
- [PayPal](/llms.txt/docs/authentication/paypal.md): PayPal provider setup and usage in Better Auth Ruby.
- [Polar](/llms.txt/docs/authentication/polar.md): Polar provider setup and usage in Better Auth Ruby.
- [Railway](/llms.txt/docs/authentication/railway.md): Railway provider setup and usage in Better Auth Ruby.
- [Reddit](/llms.txt/docs/authentication/reddit.md): Reddit provider setup and usage in Better Auth Ruby.
- [Roblox](/llms.txt/docs/authentication/roblox.md): Roblox provider setup and usage in Better Auth Ruby.
- [Salesforce](/llms.txt/docs/authentication/salesforce.md): Salesforce provider setup and usage in Better Auth Ruby.
- [Slack](/llms.txt/docs/authentication/slack.md): Slack provider setup and usage in Better Auth Ruby.
- [Spotify](/llms.txt/docs/authentication/spotify.md): Spotify provider setup and usage in Better Auth Ruby.
- [TikTok](/llms.txt/docs/authentication/tiktok.md): TikTok provider setup and usage in Better Auth Ruby.
- [Twitch](/llms.txt/docs/authentication/twitch.md): Twitch provider setup and usage in Better Auth Ruby.
- [Twitter (X)](/llms.txt/docs/authentication/twitter.md): Twitter provider setup and usage in Better Auth Ruby.
- [Vercel](/llms.txt/docs/authentication/vercel.md): Vercel provider setup and usage in Better Auth Ruby.
- [VK](/llms.txt/docs/authentication/vk.md): VK provider setup and usage in Better Auth Ruby.
- [WeChat](/llms.txt/docs/authentication/wechat.md): WeChat provider setup and usage in Better Auth Ruby.
- [Zoom](/llms.txt/docs/authentication/zoom.md): Zoom provider setup and usage in Better Auth Ruby.

### Basic Usage

- [Basic Usage](/llms.txt/docs/basic-usage.md): Getting started with Better Auth Ruby.

### Comparison

- [Comparison](/llms.txt/docs/comparison.md): Why choose Better Auth Ruby over other auth libraries, managed services, or a custom auth system.

### Concepts

- [API](/llms.txt/docs/concepts/api.md): Learn how to call Better Auth Ruby endpoints from Ruby, Rack, and Rails.
- [CLI](/llms.txt/docs/concepts/cli.md): Learn the Ruby and Rails commands used to install, migrate, inspect, and configure Better Auth.
- [Client](/llms.txt/docs/concepts/client.md): Learn how applications call Better Auth Ruby from browsers, Rails controllers, Rack apps, and server-side Ruby.
- [Cookies](/llms.txt/docs/concepts/cookies.md): Learn how Better Auth Ruby names, signs, secures, and shares cookies.
- [Database](/llms.txt/docs/concepts/database.md): Learn how Better Auth Ruby stores auth data, generates schema, uses secondary storage, and runs database hooks.
- [Email](/llms.txt/docs/concepts/email.md): Learn how to set up email verification, sign-in verification, callbacks, duplicate sign-up callbacks, and password reset emails.
- [Hooks](/llms.txt/docs/concepts/hooks.md): Learn how to customize endpoint behavior with before hooks, after hooks, endpoint context, cookies, errors, and background tasks.
- [OAuth](/llms.txt/docs/concepts/oauth.md): Learn how to configure social OAuth providers, sign in, link accounts, request scopes, refresh tokens, map profiles, and customize provider options.
- [Plugins](/llms.txt/docs/concepts/plugins.md): Learn how to use and create Better Auth Ruby plugins with endpoints, schema, hooks, middleware, request handlers, response handlers, rate limits, and trusted origins.
- [Rate Limit](/llms.txt/docs/concepts/rate-limit.md): Learn how Better Auth Ruby rate limiting works, including IP handling, IPv6 subnet keys, storage, errors, and schema.
- [Session Management](/llms.txt/docs/concepts/session-management.md): Learn how Better Auth Ruby handles session expiration, freshness, revocation, cookie cache, secondary storage, stateless sessions, and custom session responses.
- [Users And Accounts](/llms.txt/docs/concepts/users-accounts.md): Learn how to update users, change email, manage passwords, delete users, list accounts, link accounts, unlink accounts, and handle OAuth tokens.

### Examples

- [Rack Example](/llms.txt/docs/examples/rack.md): A minimal Rack app using Better Auth Ruby.
- [Rails Example](/llms.txt/docs/examples/rails.md): A Rails application using better_auth-rails.

### Guides

- [Dynamic Base URL](/llms.txt/docs/guides/dynamic-base-url.md): Configure Better Auth Ruby for preview deployments, multiple domains, and per-request URL resolution.
- [Optimizing for Performance](/llms.txt/docs/guides/optimizing-for-performance.md): A guide to optimizing your Better Auth Ruby application for performance.
- [SAML SSO with Okta](/llms.txt/docs/guides/saml-sso-with-okta.md): A guide to integrating SAML Single Sign-On (SSO) with Better Auth Ruby, featuring Okta.

### Installation

- [Installation](/llms.txt/docs/installation.md): Install and configure Better Auth Ruby.

### Integrations

- [Hanami Integration](/llms.txt/docs/integrations/hanami.md): Use Better Auth Ruby in Hanami 2.3+.
- [Rack Integration](/llms.txt/docs/integrations/rack.md): Mount Better Auth Ruby in a Rack application.
- [Rails Integration](/llms.txt/docs/integrations/rails.md): Use Better Auth Ruby in Rails.
- [Sinatra Integration](/llms.txt/docs/integrations/sinatra.md): Use Better Auth Ruby in Sinatra.

### Introduction

- [Introduction](/llms.txt/docs/introduction.md): A modern authentication framework for Ruby, inspired by Better Auth.

### Plugins

- [Two Factor](/llms.txt/docs/plugins/2fa.md): Add TOTP, OTP, backup-code, and trusted-device flows.
- [Admin](/llms.txt/docs/plugins/admin.md): Manage users and sessions as an administrator.
- [Anonymous](/llms.txt/docs/plugins/anonymous.md): Create temporary anonymous sessions.
- [API Key](/llms.txt/docs/plugins/api-key.md): Create and verify user API keys.
- [Bearer](/llms.txt/docs/plugins/bearer.md): Read sessions from Authorization bearer tokens.
- [Captcha](/llms.txt/docs/plugins/captcha.md): Verify captcha tokens before protected endpoints.
- [Device Authorization](/llms.txt/docs/plugins/device-authorization.md): OAuth device authorization flow for CLI and TV clients.
- [Dub](/llms.txt/docs/plugins/dub.md): Track Dub leads on signup and link Dub OAuth accounts.
- [Email OTP](/llms.txt/docs/plugins/email-otp.md): Email one-time passcodes for verification, sign-in, and password reset.
- [Generic OAuth](/llms.txt/docs/plugins/generic-oauth.md): Configure custom OAuth 2.0 providers.
- [Have I Been Pwned](/llms.txt/docs/plugins/have-i-been-pwned.md): Reject compromised passwords.
- [JWT](/llms.txt/docs/plugins/jwt.md): Issue and verify JWTs for authenticated sessions.
- [Last Login Method](/llms.txt/docs/plugins/last-login-method.md): Remember the last sign-in provider.
- [Magic Link](/llms.txt/docs/plugins/magic-link.md): Email one-time sign-in links.
- [MCP](/llms.txt/docs/plugins/mcp.md): OAuth endpoints for MCP clients.
- [Multi Session](/llms.txt/docs/plugins/multi-session.md): List and revoke device sessions.
- [OAuth Provider](/llms.txt/docs/plugins/oauth-provider.md): Expose this app as an OAuth 2.0 authorization server.
- [OAuth Proxy](/llms.txt/docs/plugins/oauth-proxy.md): Proxy OAuth callbacks through a stable URL.
- [One Tap](/llms.txt/docs/plugins/one-tap.md): Handle Google One Tap callback tokens.
- [One-Time Token](/llms.txt/docs/plugins/one-time-token.md): Generate and verify one-time session tokens.
- [Open API](/llms.txt/docs/plugins/open-api.md): Generate an OpenAPI schema for auth endpoints.
- [Organization](/llms.txt/docs/plugins/organization.md): Organizations, members, invitations, teams, and roles.
- [Passkey](/llms.txt/docs/plugins/passkey.md): Register and authenticate WebAuthn passkeys.
- [Phone Number](/llms.txt/docs/plugins/phone-number.md): Phone verification, sign-in, and password reset.
- [SCIM](/llms.txt/docs/plugins/scim.md): SCIM 2.0 provisioning endpoints.
- [Sign In With Ethereum](/llms.txt/docs/plugins/siwe.md): Sign in with an Ethereum wallet message.
- [SSO](/llms.txt/docs/plugins/sso.md): OIDC and SAML single sign-on providers.
- [Stripe](/llms.txt/docs/plugins/stripe.md): Stripe plugin for Better Auth Ruby to manage subscriptions and payments.
- [Username](/llms.txt/docs/plugins/username.md): Add username sign-up and sign-in to Better Auth Ruby.

### Reference

- [Contributing](/llms.txt/docs/reference/contributing.md): A concise guide to contributing to Better Auth Ruby.
- [FAQ](/llms.txt/docs/reference/faq.md): Frequently asked questions about Better Auth Ruby.
- [Options](/llms.txt/docs/reference/options.md): Better Auth Ruby configuration options reference.
- [Resources](/llms.txt/docs/reference/resources.md): A curated collection of Better Auth Ruby and upstream Better Auth resources.
- [Security](/llms.txt/docs/reference/security.md): Better Auth Ruby security features.
- [Telemetry](/llms.txt/docs/reference/telemetry.md): Telemetry behavior in Better Auth Ruby.
- [account_already_linked_to_different_user](/llms.txt/docs/reference/errors/account_already_linked_to_different_user.md): The account is already linked to a different user.
- [account_not_linked](/llms.txt/docs/reference/errors/account_not_linked.md): The provider account is not linked to the current user and cannot be linked automatically.
- [email_doesn't_match](/llms.txt/docs/reference/errors/email_doesn't_match.md): The email doesn't match the email of the account.
- [email_not_found](/llms.txt/docs/reference/errors/email_not_found.md): The provider did not return an email address.
- [Errors](/llms.txt/docs/reference/errors.md): Errors that can occur in Better Auth.
- [internal_server_error](/llms.txt/docs/reference/errors/internal_server_error.md): An unexpected error occurred during authentication.
- [invalid_callback_request](/llms.txt/docs/reference/errors/invalid_callback_request.md): The callback request is invalid.
- [invalid_code](/llms.txt/docs/reference/errors/invalid_code.md): The provided authentication code is invalid or expired.
- [no_callback_url](/llms.txt/docs/reference/errors/no_callback_url.md): The callback URL was not found in the request.
- [no_code](/llms.txt/docs/reference/errors/no_code.md): The code was not found in the request.
- [oauth_provider_not_found](/llms.txt/docs/reference/errors/oauth_provider_not_found.md): The OAuth provider was not found.
- [please_restart_the_process](/llms.txt/docs/reference/errors/please_restart_the_process.md): The OAuth state could not be parsed. The sign-in flow must be restarted.
- [signup_disabled](/llms.txt/docs/reference/errors/signup_disabled.md): Signup disabled error
- [state_mismatch](/llms.txt/docs/reference/errors/state_mismatch.md): State verification failed during the OAuth callback. Covers all state-related error codes and their causes.
- [state_not_found](/llms.txt/docs/reference/errors/state_not_found.md): The state parameter was not found in the request.
- [unable_to_create_session](/llms.txt/docs/reference/errors/unable_to_create_session.md): The session could not be created during authentication.
- [unable_to_create_user](/llms.txt/docs/reference/errors/unable_to_create_user.md): The user could not be created during authentication.
- [unable_to_get_user_info](/llms.txt/docs/reference/errors/unable_to_get_user_info.md): The user info was not found in the request.
- [unable_to_link_account](/llms.txt/docs/reference/errors/unable_to_link_account.md): The account could not be linked.
- [Unknown error](/llms.txt/docs/reference/errors/unknown.md): An unknown error occurred.

### Supported Features

- [Supported Features](/llms.txt/docs/supported-features.md): Current Better Auth Ruby support matrix.

