0.2.8 • Published 3 years ago

@coocaa/tt-auth-front-lib v0.2.8

Weekly downloads
144
License
-
Repository
-
Last release
3 years ago

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
0.2.7

3 years ago

0.2.6

3 years ago

0.2.8

3 years ago

0.2.5

3 years ago

0.2.4

3 years ago

0.2.3

3 years ago

0.2.1

3 years ago

0.2.2

3 years ago

0.2.0

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago