npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@chat21/chat21-cloud-functions-public

v1.0.36

Published

Cloud Functions for Chat21

Downloads

47

Readme

Chat21 - Firebase Cloud Functions

npm version

Chat21 is the core of the open source live chat platform Tiledesk.com.

Introduction

Chat21-cloud function is the backend module required for the operation of the other chat21 modules.

  • Send a direct message
  • Send a group message
  • Create a conversation for each message
  • Send the push notification for direct and group message
  • Send an info message to notify the creation of a group or a member joining

Pre requisites

You can find more info about Firebase Functions here https://firebase.google.com/docs/functions/get-started

Project building

git clone [email protected]:chat21/chat21-cloud-functions.git
cd functions
npm install

Project setup

  1. Login on the Firebase CLI with firebase login - it requires access to a web browser.

    • To log into the CLI in remote environments that don't allow access to localhost, use the --no-localhost flag. firebase login --no-localhost More info here https://firebase.google.com/docs/cli/
  2. Set up your Firebase project by running firebase use --add, select your Project ID

Deploy

Deploy to Firebase using the following commands:

  1. Go in the project root directory with

    cd ..
  2. Deploy

    firebase deploy

You can now see the deployed functions on the Firebase Console under Functions menu.

Tips

Run with Docker

If you prefer you can use a pre-built docker image to deploy the cloud functions to the Firebase project:

Run:

docker run -it chat21/chat21-cloud-functions sh

After that follow the "Project setup" and "Deploy paragraphs.

Test

Send your first message

  • Create a new user on the Firebase Console under Authentication Menu.
  • Select Email/Password for Authentication Provider
  • Click on "Add New User" and populate Email and Password field with for example : email = [email protected], password = 123456
  • Get a JWT token calling JWT Authentication method as described here JWT Authentication
  • Send a new message using Send Message API with JWT Authentication as described here Send message

Advanced Setup Options

Read the Setup Options page

REST API

Read the REST API page