1.0.2 • Published 3 years ago

firebase-async-trigger v1.0.2

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

Usage

Add dependency

npm install --save firebase-async-trigger
npm install --save @types/firebase-async-trigger

Import the package

Add the code to your index.ts

import { getTriggerCloudFunction } from 'firebase-async-trigger'

Export the trigger

Add the code to your index.ts

const handlers = new Map<string, (params: Map<string, string>) => Promise<void>>()

//set whatever handler functions to the map
handlers.set("trigger-name", async function(params: Map<string, string>) {
    console.log(params)
})

const trigger = getTriggerCloudFunction({
    "handlers": handlers,
    //as admin is already initialized, this will get the initialized app
    adminApp: admin.apps[0],
    slackUrl: "your_slack_trigger_url"
})
export { trigger }

Develop

Build

npm run build

Run tests

npm run tests

Run tests with coverage

npm run coverage
1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago