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
Auth0 authentication SDK for Vue.js apps
npm install @auth0/auth0-vue
Typescript
Module System
Node Version
NPM Version
57.7
Supply Chain
98.4
Quality
83.5
Maintenance
100
Vulnerability
99.6
License
TypeScript (69.03%)
JavaScript (16.99%)
Vue (13.24%)
HTML (0.73%)
Total Downloads
2,397,694
Last Day
1,062
Last Week
18,730
Last Month
132,588
Last Year
1,470,401
144 Stars
256 Commits
28 Forks
13 Watching
23 Branches
36 Contributors
Latest Version
2.3.3
Package Id
@auth0/auth0-vue@2.3.3
Unpacked Size
595.16 kB
Size
154.83 kB
File Count
37
NPM Version
10.2.3
Node Version
18.19.0
Publised On
11 Dec 2023
Cumulative downloads
Total Downloads
Last day
-84%
1,062
Compared to previous day
Last week
-43.2%
18,730
Compared to previous week
Last month
-7.4%
132,588
Compared to previous month
Last year
88.4%
1,470,401
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.