ck:better-auth

Implement authentication and authorization for TypeScript applications with a plugin-based framework.

Updated Apr 2, 2026
One-click install
npx skills add https://github.com/hidonguyen/trade-ops --skill ck-better-auth-hidonguyen
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ck:better-auth
Source: https://github.com/hidonguyen/trade-ops/tree/main/.opencode/skills/better-auth
Command: npx skills add https://github.com/hidonguyen/trade-ops --skill ck-better-auth-hidonguyen

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pytest>=8.0.0, pytest-cov>=4.1.0, pytest-mock>=3.12.0, and includes scripts (resource) and references (resource) components.

What problem does it solve?

Better Auth removes the heavy lifting of building secure, production-grade authentication and authorization systems for TypeScript applications by providing a configurable, plugin-driven framework that covers email/password, social OAuth, passkeys, 2FA, sessions, RBAC, and rate limiting.

Core Features & Use Cases

  • Built-in auth methods: Email/password, OAuth providers (GitHub, Google, Discord, etc.), magic links, and phone/email OTP flows.
  • Advanced security: Two-Factor Authentication (TOTP), passkeys/WebAuthn, backup codes, and device trust management.
  • Multi-ORM & multi-database support: Adapters and schema generation for Prisma, Drizzle, Kysely, and MongoDB with migration guidance.
  • Operational tooling: Session management, rate limiting, organization/multi-tenant support, account linking, and audit-friendly schemas.
  • Use Case: Ship authentication for a Next.js or SvelteKit app quickly with Prisma-backed users, GitHub OAuth sign-in, optional 2FA, and seamless session handling.

Quick Start

Generate an auth.ts configuration for your project, enable email/password plus GitHub OAuth, and produce a .env with BETTER_AUTH_SECRET and provider credentials.

Frequently Asked Questions about ck:better-auth

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement TypeScript authentication with OAuth and session management?

TypeScript authentication with OAuth and session management is handled through a plugin-based framework supporting email/password, social providers, 2FA, and session workflows across web frameworks like Next.js, SvelteKit, Nuxt, and Remix.

Does TypeScript authentication work with Prisma and Drizzle for database schema generation?

Yes, TypeScript authentication provides adapters and schema generation for Prisma, Drizzle, Kysely, and MongoDB, including migration guidance to sync user models and session tables with your existing database setup.

How do I add passkeys and two-factor authentication to a Next.js app?

Add passkeys and two-factor authentication to a Next.js app by enabling the advanced security plugins, which provide TOTP, WebAuthn passkeys, backup codes, and device trust management on top of standard login flows.

Can I use this authentication framework for multi-tenant organization management?

Yes, you can use this authentication framework for multi-tenant organization management, offering built-in operational tooling for organization support, account linking, RBAC, rate limiting, and audit-ready schemas.

What is the best way to set up magic links and phone OTP in a SvelteKit application?

The best way to set up magic links and phone OTP in a SvelteKit application is using the built-in authentication methods provided by the plugin-driven framework, generating a configuration file with your desired flows and environment secrets.

Do I need a specific ORM to implement rate limiting and RBAC in TypeScript?

No, you do not need a specific ORM to implement rate limiting and RBAC, as the framework supports multi-ORM compatibility including Prisma, Drizzle, Kysely, and MongoDB for operational tooling and access control.