Gathering detailed insights and metrics for @auth0/auth0-vue
Gathering detailed insights and metrics for @auth0/auth0-vue
Gathering detailed insights and metrics for @auth0/auth0-vue
Gathering detailed insights and metrics for @auth0/auth0-vue
npm install @auth0/auth0-vue
Typescript
Module System
Node Version
NPM Version
TypeScript (69.03%)
JavaScript (16.99%)
Vue (13.24%)
HTML (0.73%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
NOASSERTION License
154 Stars
266 Commits
28 Forks
16 Watchers
22 Branches
45 Contributors
Updated on Jul 05, 2025
Latest Version
2.4.0
Package Id
@auth0/auth0-vue@2.4.0
Unpacked Size
595.08 kB
Size
154.76 kB
File Count
37
NPM Version
10.7.0
Node Version
18.20.4
Published on
Jan 26, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
1
41
📚 Documentation - 🚀 Getting Started - 💻 API Reference - 💬 Feedback
This library supports Vue 3 applications. For integrating Auth0 with a Vue 2 application, please read the Vue 2 Tutorial.
Using npm:
1npm install @auth0/auth0-vue
Using yarn:
1yarn add @auth0/auth0-vue
Create a Single Page Application in the Auth0 Dashboard.
If you're using an existing application, verify that you have configured the following settings in your Single Page Application:
- Click on the "Settings" tab of your application's page.
- Scroll down and click on the "Show Advanced Settings" link.
- Under "Advanced Settings", click on the "OAuth" tab.
- Ensure that "JsonWebToken Signature Algorithm" is set to
RS256
and that "OIDC Conformant" is enabled.
Next, configure the following URLs for your application under the "Application URIs" section of the "Settings" page:
http://localhost:3000
http://localhost:3000
http://localhost:3000
These URLs should reflect the origins that your application is running on. Allowed Callback URLs may also include a path, depending on where you're handling the callback (see below).
Take note of the Client ID and Domain values under the "Basic Information" section. You'll need these values in the next step.
Create an instance of the Auth0Plugin
by calling createAuth0
and pass it to Vue's app.use()
.
1import { createAuth0 } from '@auth0/auth0-vue'; 2 3const app = createApp(App); 4 5app.use( 6 createAuth0({ 7 domain: '<AUTH0_DOMAIN>', 8 clientId: '<AUTH0_CLIENT_ID>', 9 authorizationParams: { 10 redirect_uri: '<MY_CALLBACK_URL>' 11 } 12 }) 13); 14 15app.mount('#app');
In order to add login to your application you can use the loginWithRedirect
function that is exposed on the return value of useAuth0
, which you can access in your component's setup
function.
1<script> 2 import { useAuth0 } from '@auth0/auth0-vue'; 3 4 export default { 5 setup() { 6 const { loginWithRedirect } = useAuth0(); 7 8 return { 9 login: () => { 10 loginWithRedirect(); 11 } 12 }; 13 } 14 }; 15</script>
Once setup returns the correct method, you can call that method from your component's HTML.
1<template> 2 <div> 3 <button @click="login">Log in</button> 4 </div> 5</template>
1<template> 2 <div> 3 <button @click="login">Log in</button> 4 </div> 5</template> 6 7<script> 8 export default { 9 methods: { 10 login() { 11 this.$auth0.loginWithRedirect(); 12 } 13 } 14 }; 15</script>
For more code samples on how to integrate the auth0-vue SDK in your Vue 3 application, have a look at our examples.
Explore public API's available in auth0-vue.
We appreciate feedback and contribution to this repo! Before you get started, please see the following:
To provide feedback or report a bug, please raise an issue on our issue tracker.
Please do not report security vulnerabilities on the public GitHub issue tracker. The Responsible Disclosure Program details the procedure for disclosing security issues.
Auth0 is an easy to implement, adaptable authentication and authorization platform. To learn more checkout Why Auth0?
This project is licensed under the MIT license. See the LICENSE file for more info.
No vulnerabilities found.
No security vulnerabilities found.