better-auth-python

Verify Better Auth JWTs in FastAPI backends using JWKS with caching.

Updated Jan 2, 2026
One-click install
npx skills add https://github.com/Tahasaif3/Hackathon-Todo-AI-Evolution --skill better-auth-python-tahasaif3
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: better-auth-python
Source: https://github.com/Tahasaif3/Hackathon-Todo-AI-Evolution/tree/main/.claude/skills/better-auth-python
Command: npx skills add https://github.com/Tahasaif3/Hackathon-Todo-AI-Evolution --skill better-auth-python-tahasaif3

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill enables Python FastAPI backends to securely verify JWTs issued by a Better Auth TypeScript server using JWKS, enabling robust authentication and user-scoped access across microservices.

Core Features & Use Cases

  • JWT verification workflow using JWKS with caching for FastAPI endpoints
  • Protected routes and get_current_user dependency to enforce user isolation
  • ORM integration templates for SQLModel or SQLAlchemy to relate data to the authenticated user
  • Platform-agnostic integration with Next.js frontends and Better Auth server

Quick Start

Copy the provided templates to your project, set BETTER_AUTH_URL, install dependencies (pyjwt cryptography httpx), and wire get_current_user into your FastAPI app to secure routes.

Frequently Asked Questions about better-auth-python

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

FAQPage Schema
How do I verify Better Auth JWTs in a FastAPI backend using JWKS?

To verify Better Auth JWTs in FastAPI, you fetch the JWKS from your Better Auth TypeScript server, cache the keys, and use RSA256 to validate the Bearer token. This skill provides templates to wire that workflow directly into your endpoints.

What is the best way to secure FastAPI routes with tokens issued by a TypeScript auth server?

Securing FastAPI routes with TypeScript-issued tokens involves decoding the Bearer token against the issuer's JWKS. This skill provides a get_current_user dependency to enforce user isolation and protect data access across your Python microservices.

Can I use SQLModel or SQLAlchemy to relate database records to the authenticated Better Auth user?

Yes, you can relate database records to the authenticated Better Auth user. This skill includes ORM-ready integration templates for both SQLModel and SQLAlchemy to connect your protected FastAPI data directly to the verified user identity.

Do I need to manually fetch public keys every time I verify a JWT in FastAPI?

You do not need to manually fetch public keys for every JWT verification request. This skill implements JWKS fetching with local caching, reducing external calls to your Better Auth server while maintaining secure RSA256 token validation.

How does a Next.js frontend integrate with a FastAPI backend using Better Auth for authentication?

A Next.js frontend integrates with FastAPI by sending a Better Auth JWT as a Bearer token in requests. The FastAPI backend validates this token against the cached JWKS to authenticate the user and scope data access accordingly.