Better Auth

Authenticate users and manage sessions with Better Auth in LivestockAI.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/captjay98/livestockai --skill better-auth-captjay98
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Better Auth
Source: https://github.com/captjay98/livestockai/tree/main/.kiro/skills/better-auth
Command: npx skills add https://github.com/captjay98/livestockai --skill better-auth-captjay98

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

LivestockAI authentication and session management are centralized with Better Auth to enforce secure credentials, consistent sign-in flows, and role-based access control across the platform.

Core Features & Use Cases

  • Password storage uses PBKDF2 with 100,000 iterations and SHA-256 to protect credentials.
  • Helper to create users with auth ensures corresponding entries in users and account tables and supports role assignment.
  • Server middleware and client-side hooks provide protected routes and seamless login experiences for admins and standard users.

Quick Start

Configure the Better Auth integration in your app startup and seed an initial user with createUserWithAuth to begin.

Frequently Asked Questions about Better Auth

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

FAQPage Schema
How do I implement secure authentication and session management in TypeScript?

You can implement secure authentication and session management in TypeScript using Better Auth, which enforces PBKDF2 password hashing with 100,000 SHA-256 iterations and configurable session policies for protected routes.

What is the best way to hash passwords for multi-role access control?

The best way to hash passwords for multi-role access control is using PBKDF2 with 100,000 iterations and SHA-256, ensuring secure credential storage while assigning roles during user creation.

How do I create seed users with authentication and role assignments?

To create seed users with authentication and role assignments, use the createUserWithAuth helper, which ensures corresponding entries in users and account tables and supports role assignment.

Can I use server middleware for protected routes and client-side login flows?

Yes, you can use server middleware for protected routes and client-side hooks for login flows, providing seamless authentication experiences for admins and standard users across web interfaces.

Does Better Auth work without external dependencies for authorization?

Better Auth works without external dependencies for authorization, centralizing secure credentials, sign-in flows, and role-based access control entirely within the application architecture.