@coocaa/tt-auth-front-lib
v0.2.8
Published
## Project setup ``` npm install @coocaa/tt-auth-front-lib-lib ```
Downloads
29
Readme
auth-front
Project setup
npm install @coocaa/tt-auth-front-lib-lib
setup
import Vue from 'vue'
import * as auth from ' @coocaa/tt-auth-front-lib'
const firebaseConfig = {
apiKey: "xxxxxxxxxxxxxxxxxxx",
authDomain: "xxxxxxxx.firebaseapp.com",
databaseURL: "https://xxxxxxxx.firebaseio.com",
projectId: "xxxxxxxxx",
storageBucket: "xxxxxxxxx.appspot.com",
messagingSenderId: "xxxxxxxxxxxxx",
appId: "x:xxxxxxxxxxxxx:web:xxxxxxxxxxxxxxxxx",
measurementId: "x-xxxxxxxxx"
};
Vue.use(auth, firebaseConfig)
usage
to display the connections buttons
<tt-auth />
in any component you have access to those method and attributes
this.$user: {uid: string}
this.$logout(): Promise<null>
this.$getFirebaseToken(): Promise<string> // you must be logged in before using it
this.$getUser(id: string): Promise<{ name: string, tag: string, bio: string, profilPicture: string, profilBanner: string }>
this.$setUser(user: { name?: string, bio?: string, profilPicture?: string, profilBanner?: string }): Promise<{ name: string, tag: string, bio: string, profilPicture: string, profilBanner: string }> // you must be logged in before using it
or get the token by the plugin directly (you must install the plugin before anyway)
import { getFirebaseToken } from ' @coocaa/tt-auth-front-lib'
getFirebaseToken(): Promise<string> // you must be logged in before using it