@coocaa/tt-auth-front-lib

0.2.8 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i @coocaa/tt-auth-front-lib

Weekly Downloads

1

Version

0.2.8

License

none

Unpacked Size

7.05 kB

Total Files

4

Last publish

Collaborators

  • coocaa