Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

trollbox

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

trollbox

Instant trollbox using Firebase.

  • 0.0.20
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

trollbox

Instant trollbox using Firebase.

Demo

https://lab.miguelmota.com/trollbox

Install

npm install trollbox

Instructions

  1. Create a new Firebase project.

  2. Set read/write rules to be global in Firebase.

Firebase dashboard console -> Database -> Rules

{
  "rules": {
    ".read": true,
    ".write": true
  }
}
  1. Set up HTML container:
<div id="trollbox"></div>
  1. Copy Firebase project config from dashboard and initialize trollbox:
const Trollbox = require('trollbox')

const config = {
  // DOM selector for trollbox
  container: '#trollbox',

  // Firebase project config found in dashboard
  firebase: {
    apiKey: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
    authDomain: 'xxxxxxxx-xxxxx.firebaseapp.com',
    databaseURL: 'https://xxxxxxxx-xxxxx.firebaseio.com',
    projectId: 'xxxxxxxx-xxxxx',
    storageBucket: 'xxxxxxxx-xxxxx.appspot.com',
    messagingSenderId: 'xxxxxxxxxxxx'
  },

  // trollbox channel name (chat room)
  channel: 'global',

  // trollbox username
  user: 'anon'
}

const trollbox = new Trollbox(config)
  1. Copy base trollbox.css stylesheet into your web app.

  2. That's it!

Later on if you need to, you can change the channel name and user:

trollbox.setChannel('random')
trollbox.setUser('Bob')

You can also completely destroy the trollbox:

trollbox.destroy()

License

MIT

Keywords

FAQs

Package last updated on 06 Oct 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc