Skip to content
This repository was archived by the owner on Nov 21, 2022. It is now read-only.

Commit e0b229c

Browse files
ArmandoHerrabdeo
authored andcommitted
docs/nuxt-docs
Added installation instructions for the vuex-cognito-module for users working on Nuxt projects.
1 parent 2fe69de commit e0b229c

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

packages/cognito-module/docs/guide/install.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,25 @@
33
Vuex module to interface with AWS Cognito
44

55
Install:
6+
7+
```bash
8+
npm install @vuetify/vuex-cognito-module
9+
```
10+
611
```bash
712
yarn add @vuetify/vuex-cognito-module
813
```
914

15+
## Vue
16+
1017
Import into your project's entry point (**src/main.js** in most Vue projects)
1118

1219
```js
1320
import attachCognitoModule from '@vuetify/vuex-cognito-module'
1421
```
1522

1623
Attach cognito module to the store
24+
1725
```js
1826
import store from './store'
1927

@@ -26,4 +34,31 @@ attachCognitoModule(store, {
2634
```
2735

2836
### Example Project
37+
2938
An example project can be found [here](https://github.com/vuetifyjs/vuex-cognito-example)
39+
40+
## Nuxt
41+
42+
Create a Nuxt plugin in the **plugins/** directory in your Nuxt project.
43+
44+
Within your plugin file attach the cognito module to the store
45+
46+
```js
47+
import attachCognitoModule from '@vuetify/vuex-cognito-module'
48+
49+
export default (ctx, inject) => {
50+
const store = ctx.store
51+
attachCognitoModule(store, {
52+
userPoolId: 'your-data-here',
53+
identityPoolId: 'your-data-here',
54+
userPoolWebClientId: 'your-data-here',
55+
region: 'your-data-here'
56+
}, 'cognito')
57+
}
58+
```
59+
60+
And finally in your **nuxt.config.js** file register your plugin.
61+
62+
```js
63+
plugins: ['@/plugins/vuex-cognito-module.js']
64+
```

0 commit comments

Comments
 (0)