|
1 | | -# vuex-cognito-module |
| 1 | +# vuex-firebase-auth-module |
2 | 2 |
|
3 | | -Vuex module to interface with AWS Cognito |
| 3 | +Vuex module to interface with Google Firebase |
4 | 4 |
|
5 | 5 | Docs Link: Coming Soon! |
6 | 6 |
|
7 | 7 | Install: |
8 | 8 | ```bash |
9 | | -yarn add @vuetify/vuex-cognito-module |
| 9 | +yarn add @vuetify/vuex-firebase-auth-module |
10 | 10 | ``` |
11 | 11 |
|
12 | 12 | Import into your project's entry point (main.js in most Vue projects) |
13 | 13 | ```js |
14 | | -import attachCognitoModule from '@vuetify/vuex-cognito-module'; |
| 14 | +import attachFirebaseAuthModule from '@vuetify/vuex-firebase-auth-module'; |
15 | 15 | ``` |
16 | 16 |
|
17 | | -Attach cognito module to the store |
| 17 | +Attach auth module to the store |
18 | 18 | ```js |
| 19 | +import firebase from 'firebase/app' |
| 20 | +import 'firebase/auth' |
| 21 | + |
19 | 22 | import store from './store'; |
20 | | -attachCognitoModule(store, { |
21 | | - userPoolId: 'your-data-here', |
22 | | - identityPoolId: 'your-data-here', |
23 | | - userPoolWebClientId: 'your-data-here', |
24 | | - region: 'your-data-here', |
25 | | -}, 'cognito') |
| 23 | + |
| 24 | +const config = { |
| 25 | + apiKey: 'your-api-key', |
| 26 | + authDomain: 'your-auth-domain', |
| 27 | + databaseURL: 'your-database-url', |
| 28 | + projectId: 'your-project-id', |
| 29 | + storageBucket: 'your-storage-bucket', |
| 30 | + messagingSenderId: 'your-sender-id', |
| 31 | +} |
| 32 | + |
| 33 | +const firebaseApp = firebase.initializeApp(config) |
| 34 | +const auth = firebaseApp.auth() |
| 35 | + |
| 36 | +attachFirebaseAuthModule(store, auth, 'auth') |
26 | 37 | ``` |
0 commit comments