ck:better-auth

Provide authentication and authorization for TypeScript and JavaScript applications.

1|Updated Mar 6, 2026
One-click install
npx skills add https://github.com/quanganh208/cookmate --skill ck-better-auth-quanganh208
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ck:better-auth
Source: https://github.com/quanganh208/cookmate/tree/main/.opencode/skills/better-auth
Command: npx skills add https://github.com/quanganh208/cookmate --skill ck-better-auth-quanganh208

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Better Auth removes the complexity of implementing secure, production-ready authentication and authorization in TypeScript and JavaScript applications by providing a unified, extensible framework that handles credentials, social login, and advanced auth features.

Core Features & Use Cases

  • Built-in Email/Password and OAuth: Ready-made flows for email/password, GitHub, Google, Discord and many other providers.
  • Advanced Security: Optional plugins for two-factor (TOTP), passkeys/WebAuthn, magic links, and session revocation.
  • Operational Tools: Database adapters (Prisma, Drizzle, Kysely, MongoDB), schema generation/migrations, rate limiting, RBAC, and multi-organization support.
  • Use Case: Integrate into a Next.js or Expo backend to provide user signup/signin, social login, 2FA enrollment, and session management with minimal wiring.

Quick Start

Install Better Auth, add BETTER_AUTH_SECRET and BETTER_AUTH_URL to your environment, create an auth.ts instance with your chosen database adapter, and mount the provided API handler in your framework.

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 passkeys?

TypeScript authentication with OAuth and passkeys is implemented via a unified framework providing built-in email/password, social login, and WebAuthn plugins. It supports multi-provider OAuth, TOTP, and passkey enrollment for secure access.

Can I use this authentication framework with Next.js and SvelteKit?

Yes, this authentication framework works with Next.js, SvelteKit, Remix, and standalone servers. You can mount the provided API handler directly in your web or mobile backend to manage sessions and authorization.

What's the best way to add two-factor authentication and RBAC to a JavaScript backend?

Adding two-factor authentication and RBAC to a JavaScript backend is handled through optional plugins and built-in organization management. The framework supports TOTP, session revocation, and role-based access control with minimal wiring.

How do I configure database adapters for session management in TypeScript?

Database adapters for session management in TypeScript are configured by creating an auth instance with your chosen adapter. Supported adapters include Prisma, Drizzle, Kysely, and MongoDB, enabling schema generation and automated migrations.

Do I need environment variables to set up TypeScript authentication?

Yes, you need to set BETTER_AUTH_SECRET and BETTER_AUTH_URL environment variables to initialize TypeScript authentication. After adding these, create an auth instance and mount the API handler to start managing user sessions.

How does rate limiting work with multi-organization access control?

Rate limiting with multi-organization access control operates as an operational tool within the authentication framework. It restricts request frequencies alongside RBAC policies to secure endpoints across different organizational entities.