auth0-spa-js
Add authentication to Vanilla JS, Svelte, or framework-agnostic SPAs.
Developer Setup
Setup & Installation
npx skills add https://github.com/auth0/agent-skills --skill auth0-spa-jsnpx skills add https://github.com/auth0/agent-skills --skill auth0-spa-jsOverview
What This Skill Does
Add authentication to any browser-based single-page application using `@auth0/auth0-spa-js` — the low-level Auth0 SDK for Vanilla JS, Svelte, SolidJS, and any SPA not using React, Angular, or Vue. > **Agent instruction:** Before providing SDK setup instructions, fetch the latest release version by running: > ``` > gh api repos/auth0/auth0-spa-js/releases/latest --jq '.tag_name' > ``` > Use the returned version in all dependency lines instead of any hardcoded version below. If the command fails, fall back to checking https://github.com/auth0/auth0-spa-js/releases. #
Application
When to use this Skill
- Adding secure Auth0 authentication to a Spa js application
- Implementing standard login, logout, and token authentication flows in Spa js
- Managing user session state and securing frontend/backend routes using Auth0 SDKs
Documentation
Show Skills.md file
Auth0 SPA JS Integration
Add authentication to any browser-based single-page application using @auth0/auth0-spa-js — the low-level Auth0 SDK for Vanilla JS, Svelte, SolidJS, and any SPA not using React, Angular, or Vue.
Agent instruction: Before providing SDK setup instructions, fetch the latest release version by running:
gh api repos/auth0/auth0-spa-js/releases/latest --jq '.tag_name'Use the returned version in all dependency lines instead of any hardcoded version below. If the command fails, fall back to checking https://github.com/auth0/auth0-spa-js/releases.
Prerequisites
- Modern browser with ES2017+ support
- npm or yarn (or use CDN for no-bundler apps)
- Auth0 account with a Single Page Application configured
- If you don't have Auth0 set up, see auth0-quickstart
When NOT to Use
- React SPAs (hooks, Auth0Provider): Use auth0-react
- Angular SPAs (AuthModule, AuthGuard): Use auth0-angular
- Vue 3 SPAs (createAuth0, useAuth0): Use auth0-vue
- Next.js (server-side sessions, App Router): Use auth0-nextjs
- Nuxt (server-side SSR): Use auth0-nuxt
- Express server-side web apps: Use auth0-express
Recommendations