Code Monkey home page Code Monkey logo

firebase-logsnag-extension's Introduction

Firebase LogSnag Extension (Unofficial)

Install the extension using this link

Author: Nikhil Kothari (https://github.com/nikkothari22)

Description: Functions to send events and insights to LogSnag. (Not an official extension)

This is not an official Logsnag extension and the author is not associated with LogSnag or Firebase in any manner whatsoever. All trademarks and copyrights belong to the respective companies.

Details: Use this extension to publish events and insights to your LogSnag channel. The extension uses the official LogSnag Node.js library.

You need to have a LogSnag account and get the authentication (Access) token and the project name (refer to the LogSnag documentation for this). When you need to publish an event or insight, simply create a new document in Firestore.

The extension has a cloud function that's triggered whenever a new document is created in the collections specified during installation.

Here's a basic example document write that would trigger this extension to publish an event in LogSnag:

admin.firestore().collection('logsnagEvents').add({
    channel: "waitlist",
    event: "User Joined",
    description: "Email: [email protected]",
    icon: "πŸŽ‰",
    tags: {
      name: "john doe",
      email: "[email protected]",
    },
    notify: true
})

To publish an insight, you would need to write a document in another collection:

admin.firestore().collection('logsnagInsights').add({
    title: "User Count",
    value: "100",
    icon: "πŸ‘¨"
})

Additional setup

Before installing this extension, make sure that you've set up a Cloud Firestore database in your Firebase project.

Billing

To install an extension, your project must be on the Blaze (pay as you go) plan

  • You will be charged a small amount (typically around $0.01/month) for the Firebase resources required by this extension (even if it is not used).
  • This extension uses other Firebase and Google Cloud Platform services, which have associated charges if you exceed the service’s free tier:
    • Cloud Firestore
    • Cloud Functions (Node.js 16 runtime. See FAQs)

Cloud Functions:

  • processEvent: Runs when a document is created in the specified Cloud Firestore collection for events, publishes the event in LogSnag, and updates the document with delivery status information.

  • processInsight: Runs when a document is created in the specified Cloud Firestore collection for insights, publishes the insight in LogSnag, and updates the document with delivery status information.

Access Required:

This extension will operate with the following project IAM roles:

  • datastore.user (Reason: Allows this extension to access Cloud Firestore to read and process added email documents.)

Configuration Parameters:

  • Cloud Functions location: Where do you want to deploy the functions created for this extension? You usually want a location close to your customers. For help selecting a location, refer to the location selection guide.

  • Events Collection path: The path to the collection where documents will be created to publish events in LogSnag.

  • Insights Collection path: The path to the collection where documents will be created to publish insights in LogSnag.

firebase-logsnag-extension's People

Contributors

nikkothari22 avatar

Stargazers

Roman avatar Shayan avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.