@coocaa/auth-front-lib

0.1.0 • Public • Published

auth-front

Project setup

npm install @coocaa/auth-front-lib

setup

import Vue from 'vue'
import * as auth from '@coocaa/auth-front'

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

in any component you have access to those method and attributes

this.$user: {uid: string}
this.$logout()
this.$getFirebaseToken(id: string): Promise<string> // you must be logged in before using this
this.$getProfilTag(id: string): Promise<string>
this.$setProfilName(name: string): Promise<null> // you must be logged in before using this
this.$getProfilName(id: string): Promise<string>
this.$setProfilBio(bio: string): Promise<null> // you must be logged in before using this
this.$getProfilBio(id: string): Promise<string>
this.$setProfilPictureUrl(url: string): Promise<null> // you must be logged in before using this
this.$getProfilPictureUrl(id: string): Promise<string>
this.$setProfilBannerUrl(url: string): Promise<null> // you must be logged in before using this
this.$getProfilBannerUrl(id: string): Promise<string>

or get the token by the plugin directly (you must install the plugin before anyway)

import { getFirebaseToken } from '@coocaa/auth-front'

getFirebaseToken(): Promise<string> // you must be logged in before using this

Readme

Keywords

none

Package Sidebar

Install

npm i @coocaa/auth-front-lib

Weekly Downloads

1

Version

0.1.0

License

none

Unpacked Size

7.86 kB

Total Files

4

Last publish

Collaborators

  • coocaa