Skip to content

Commit 26f7675

Browse files
author
simmatrix
authored
Created README file
1 parent ff94d14 commit 26f7675

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# vue-google-auth
2+
Handling Google sign-in and sign-out for Vue.js applications
3+
4+
## Installation
5+
`npm install simmatrix/vue-google-auth`
6+
7+
## Initialization
8+
```
9+
import GoogleAuth from 'vue-google-auth'
10+
11+
Vue.use(GoogleAuth, { clientID: 'xxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com' })
12+
Vue.googleAuth().load()
13+
```
14+
Ideally you shall put in this in your main file, e.g. main.js
15+
16+
## Usage
17+
Handling Google sign-in, this is added within the login page
18+
```
19+
import Vue from 'vue'
20+
21+
Vue.googleAuth().signIn(function () {
22+
// things to do when sign-in succeeds
23+
}, function () {
24+
// things to do when sign-in fails
25+
))
26+
```
27+
28+
Handling Google sign-out
29+
```
30+
import Vue from 'vue'
31+
32+
Vue.googleAuth().signOut(function () {
33+
// things to do when sign-out succeeds
34+
}, function () {
35+
// things to do when sign-out fails
36+
))
37+
```

0 commit comments

Comments
 (0)