botkit-storage-firestore

1.0.4 • Public • Published

botkit-storage-firestore Build Status

A Firebase storage module for Botkit.

Usage

Just require botkit-storage-firestore and pass it a config with a firebase_uri option. Then pass the returned storage when creating your Botkit controller. Botkit will do the rest.

Make sure everything you store has an id property, that's what you'll use to look it up later.

const admin = require('firebase-admin');
var serviceAccount = require(process.env.FIREBASE_URI);
admin.initializeApp({
    credential: admin.credential.cert(serviceAccount)
});
 
var db = admin.firestore();

var Botkit = require('botkit'),
    firebaseStorage = require('botkit-storage-firestore')({database: db}),
    controller = Botkit.slackbot({
        storage: firebaseStorage
    });
// then you can use the Botkit storage api, make sure you have an id property
var beans = {id: 'cool', beans: ['pinto', 'garbanzo']};
controller.storage.teams.save(beans);
beans = controller.storage.teams.get('cool');

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.4
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.4
    0
  • 1.0.3
    0
  • 1.0.2
    0
  • 1.0.1
    0

Package Sidebar

Install

npm i botkit-storage-firestore

Weekly Downloads

0

Version

1.0.4

License

MIT

Unpacked Size

16.8 kB

Total Files

11

Last publish

Collaborators

  • shishirsharma