# Authentication

How auth works in agent-native apps.

- Repository: https://github.com/BuilderIO/agent-native (7579 stars)
- Category: Testing
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add BuilderIO/agent-native --skill authentication -g -a claude-code -y`
Codex: `npx skills add BuilderIO/agent-native --skill authentication -g -a codex -y`
Cursor: `npx skills add BuilderIO/agent-native --skill authentication -g -a cursor -y`
Gemini CLI: `npx skills add BuilderIO/agent-native --skill authentication -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add BuilderIO/agent-native`

## Description

How auth works in agent-native apps. Use when wiring login/signup, configuring auth modes, setting up organizations, protecting routes, or debugging session issues.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Authentication

## Rule

Auth is powered by **Better Auth** with account-first design. Every new user creates an account on first visit. Use `getSession(event)` to authenticate custom routes; actions are auto-protected. Normal app HTML and React Router page-data responses are one impersonal, public-cacheable shell for every visitor. The client decides whether to render private UI or redirect to sign-in.

## Auth Modes

The rest: https://github.com/BuilderIO/agent-native/blob/HEAD/.agents/skills/authentication/SKILL.md
