netlify-identity

Implement authentication, OAuth, and role-based access control on Netlify using @netlify/identity.

1|Updated May 13, 2026
One-click install
npx skills add https://github.com/SyedArmanAli2003/AgroNaV --skill netlify-identity-syedarmanali2003
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: netlify-identity
Source: https://github.com/SyedArmanAli2003/AgroNaV/tree/main/.agents/skills/netlify-identity
Command: npx skills add https://github.com/SyedArmanAli2003/AgroNaV --skill netlify-identity-syedarmanali2003

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @netlify/identity, @netlify/functions, and includes references (resource) components.

What problem does it solve? Adding user authentication to a Netlify site involves signups, logins, OAuth providers, password recovery, and role-based access control, and using deprecated libraries like netlify-identity-widget or gotrue-js leads to broken implementations. This Skill guides you through the modern @netlify/identity API and the dashboard configuration steps required to make auth work end-to-end. ## Core Features & Use Cases - Headless Auth API: Implement login, signup, logout, OAuth redirects, and auth callbacks with typed TypeScript functions that work in browsers, Netlify Functions, and SSR frameworks. - Dashboard Handoff Checklists: Generate exact dashboard configuration steps for enabling Identity, registration modes, autoconfirm, and external OAuth providers, since these have no public API. - Roles & Event Functions: Assign roles at signup via Identity event functions (userSignup, userValidate) and protect routes with role-based redirects in netlify.toml. - Use Case: You are building a prototype app on Netlify that needs email/password plus Google login. The Skill scaffolds the auth UI, runs a draft deploy, hands you the dashboard checklist, and verifies the production deploy. ## Quick Start Add Netlify Identity authentication with email/password and Google OAuth login to my Netlify site.

Frequently Asked Questions about netlify-identity

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

FAQPage Schema
How do I add authentication to a Netlify site?

Install @netlify/identity and use its headless functions like login, signup, and getUser in your browser code or Netlify Functions. You must also enable Identity in the Netlify dashboard under project configuration before any auth flow works.

Should I use netlify-identity-widget or @netlify/identity?

Use @netlify/identity. The netlify-identity-widget and gotrue-js packages are deprecated. The new library provides a unified, headless TypeScript API that works in browsers, Netlify Functions, Edge Functions, and SSR frameworks.

Does Netlify Identity work with netlify dev for local testing?

No, Identity does not currently work with netlify dev. You must deploy to Netlify to test auth features, using npx netlify deploy for preview deploys during development.

How do I add Google or GitHub OAuth login to Netlify Identity?

Enable the provider in the Netlify dashboard under Identity settings, then call oauthLogin('google') to redirect the user and handleAuthCallback() on page load to process the return. The 'Use Netlify's app' option requires no client ID or secret.

How do I assign admin roles to users in Netlify Identity?

The first admin must be created manually in the dashboard by inviting the user and adding the admin role on their detail page. After that, roles can be assigned programmatically in Identity event functions like userSignup via app_metadata.roles.

Why does my Netlify Identity signup endpoint return 404?

A 404 on /.netlify/identity/signup means the Identity instance is not enabled in the dashboard. There is no API to enable it; you must toggle it at the project's Identity configuration page, then redeploy.