authentication
यह क्या करती है
यह स्किल बताती है कि Agent-Native ऐप में प्रमाणीकरण कैसे काम करता है, जो Better Auth इस्तेमाल करता है। इसमें development और production मोड, कस्टम रूट की सुरक्षा और organizations शामिल हैं। यह लॉगिन सेट करने या ठीक करने वाले डेवलपर्स के लिए है।
कब इस्तेमाल करें
- ✓जब आप Agent-Native ऐप में साइन-अप या लॉगिन जोड़ रहे हैं।
- ✓जब आप कोई कस्टम रूट सुरक्षित करना चाहते हैं, ताकि उसे केवल साइन-इन यूज़र इस्तेमाल करें।
- ✓जब किसी यूज़र को session की समस्या हो और आपको कारण पता करना हो।
Skill का लिंक
https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/authentication/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“क्या आप मेरे Agent-Native ऐप के लिए साइन-अप और लॉगिन सेट कर सकते हैं, जिसमें Google साइन-इन एक विकल्प हो?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
स्किल बताती है कि नए यूज़र पहली विज़िट पर खाता कैसे पाते हैं, session कैसे जांचा जाता है, और production में कौन से साइन-इन तरीके उपलब्ध हैं।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
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
| Mode | Behavior |
|---|---|
| Development (default) | Real Better Auth — same flow as production. There is no auth bypass. On first run the framework auto-creates a throwaway dev account and signs you in without printing its credentials (disable with AGENT_NATIVE_DISABLE_AUTO_DEV_ACCOUNT=1), so you are not stuck at a login wall. getSession() returns the signed-in user or null — it never falls back to a sentinel identity. |
| Production (default) | Magic-link-first Better Auth when outbound email is ready, with email/password fallback and social providers (Google, GitHub). Organizations built in. |
AUTH_MODE=local |
Not a browser auth bypass, and never returns local@localhost. It only affects CLI/agent identity: it lets pnpm action / the local agent loop auto-bind to the single real signed-in dev user from the sessions table (see scripts/dev-session.ts). Browser login is unchanged. |
AUTH_SKIP_EMAIL_VERIFICATION=1 |
QA/preview escape hatch for password-fallback accounts. Signup skips email verification and does not send the signup verification email. Local dev/test skips verification by default; set AUTH_SKIP_EMAIL_VERIFICATION=0 only when testing verification itself. It does not change magic-link delivery. Give test accounts a test-identity address, such as an-e2e-probe-you@example.com or one containing +qa-test-bot- (the rule is isTestIdentityEmail in packages/core/src/shared/qa-test-email.ts), so they stay out of metrics. Test identities still get sign-in, verification, password-reset, and org-invitation mail, but no share notices or other app email. |
auth.requireEmailVerification |
Declares the password-signup verification policy for any environment, production included, via defineAppConfig({ auth: { requireEmailVerification: false } }) or AUTH_REQUIRE_EMAIL_VERIFICATION=0. A declared value outranks AUTH_SKIP_EMAIL_VERIFICATION and the per-environment default. false accepts an unverified address as a login credential; true with no email provider disables password signup instead of stranding accounts on a verification nobody can deliver. |
AUTH_MAGIC_LINK=0 |
Force the email/password fallback even when outbound email is ready. |
AUTH_DISABLED=true |
Skip login/signup entirely — every request runs as dev@local.test. For local dev, cloud previews, and internal demos only; not for production with real users. |
ACCESS_TOKEN / ACCESS_TOKENS |
Static bearer fallback for MCP/connect clients that cannot use OAuth. Not browser auth and never a token login page. |
| Custom | Pass your own getSession to autoMountAuth(app, { getSession }). |
Auth emails (verify signup, reset password, magic link, email change) and org
invites render through renderTransactionalEmail. An app changes their copy or
design with overrideTransactionalEmail(id, render) from a server plugin, never
by editing better-auth-instance.ts call sites. See
/docs/deployment#email-templates.
Hosted Sign-In Pages and the Shared Wave
- First-party server auth plugins use
createToolkitAuthPluginfrom@agent-native/toolkit/app/auth/server. It server-rendersAuthPageandResetPasswordPagebefore hydration. Direct CorecreateAuthPlugincalls leave generic fallback markup in the response and can flash before React replaces it. AuthPageuses Toolkit's full-pageWaveBackgroundfor every auth view. The Agent-Native homepage hero and Calendar booking use the same renderer: Calendar's animated FFT ocean wave. Keep the background empty while WebGPU support is checked and when the ocean renderer is unavailable
अक्सर पूछे जाने वाले सवाल
क्या development में साइन-इन छोड़ने का कोई तरीका है?
स्किल कहती है कि कोई auth bypass नहीं है। पहली बार चलाने पर अपने-आप एक development खाता बन जाता है।
कस्टम रूट कैसे सुरक्षित होते हैं?
कस्टम रूट session जांच का उपयोग करते हैं, और action अपने-आप सुरक्षित रहते हैं।
production में कौन से साइन-इन विकल्प हैं?
स्किल magic links, ईमेल और पासवर्ड का विकल्प, और Google तथा GitHub सोशल लॉगिन का ज़िक्र करती है।
जानकारी
लेखक का मूल विवरण
How auth works in agent-native apps. Use when wiring login/signup, configuring auth modes, setting up organizations, protecting routes, or debugging session issues.
repo: BuilderIO/agent-native
लोकप्रियता
- GitHub स्टार
- 7.6k
- रैंकिंग में स्थान
- #13137
- लाइसेंस
- MIT
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
design-exploration
7.6kयह आपके एजेंट को UI के कई डिज़ाइन विकल्प साथ-साथ दिखाने, आपकी पसंद चुनवाने और फिर चुने डिज़ाइन को सुधारने में मदद करती है।
visual-edit
7.6kयह आपके एजेंट को चल रहे लोकल ऐप को विज़ुअल एडिटर में खोलने देती है, ताकि आप उसकी असली स्क्रीन एक साथ देखकर संपादित कर सकें।
turn-into-app
7.6kयह किसी वर्कफ़्लो, स्प्रेडशीट या प्रोजेक्ट को भरी हुई स्क्रीन वाले विज़ुअल ऐप में बदलती है, जिसके कंट्रोल के पीछे एजेंट काम करता है।
visual-plan
7.6kयह सादे टेक्स्ट वाली योजना को डायग्राम, फ़ाइल नक्शों, कोड अंश और खुले सवालों वाली इंटरैक्टिव विज़ुअल योजना में बदलती है।
मिलती-जुलती skills
api-connector-builder
280kयह आपके एजेंट को मौजूदा pattern के हिसाब से नए API connections बनाने देता है। जब बिना कोई नया तरीका बनाए एक और integration जोड़ना हो, तब इसका इस्तेमाल करें।
api-design
280kयह आपके एजेंट को best practices के हिसाब से REST APIs डिज़ाइन करने में मदद करता है। यह तय करने में काम आता है कि APIs आपस में कैसे बात करें, errors कैसे दिखें, और data को कैसे व्यवस्थित करें।
backend-patterns
280kआपके एजेंट को server-side architecture patterns और database optimization में मदद करता है। server पर चलने वाला code बनाने या review करने के लिए उपयोगी है।