7.0.0 • Published 4 years ago

@onboardmobility/firebase v7.0.0

Weekly downloads
83
License
ISC
Repository
bitbucket
Last release
4 years ago

@onboardmobility/firebase

Contains auxiliary methods related to Firebase authentication and notification.

Usage

Authentication

For protectedApi (validate token only)

const protectedApi = require('@onboardmobility/firebase').authentication.firebaseAuth.protectedApi;
const user = await protectedApi(token);

For authorizedApi (valid types {type:''} and modules:[] must be set on Firebase user claims)

const authorizedApi = require('@onboardmobility/firebase').authentication.firebaseAuth.authorizedApi;
const user = await authorizedApi(req.headers.authorization, {
    types: [
        { type: 'supervisor'},
    ],
    modules:['CARS']
});

Notification

const firebaseNotification = require('@onboardmobility/firebase').notification.notificationHelper;
await firebaseNotification.sendFirebaseNotification({title: 'title', body: 'body', tokens,});
7.0.0

4 years ago

6.0.0

4 years ago

5.0.0

4 years ago

4.0.0

4 years ago

4.0.2

4 years ago

3.0.8

4 years ago

3.0.0

4 years ago

2.2.2

5 years ago

2.2.1

5 years ago

2.2.0

5 years ago

2.1.6

5 years ago

2.1.0

5 years ago

2.0.0

5 years ago

1.0.8

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago