{"id":18172,"library":"bot-middleware-jubi","title":"bot-middleware-jubi","description":"bot-middleware-jubi is a Node.js server middleware for building chatbot backends with support for Facebook Messenger, Twilio WhatsApp, Firebase Cloud Messaging (FCM), and web sockets. Version 1.0.102 is the latest. It requires MongoDB for storage and optionally Redis for clustering. The package provides a unified configuration interface for multiple channels, including passphrase-based authentication, dashbot integration, and static file serving. It is primarily used with CommonJS require() and has minimal TypeScript support.","status":"active","version":"1.0.102","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install bot-middleware-jubi","lang":"bash","label":"npm"},{"cmd":"yarn add bot-middleware-jubi","lang":"bash","label":"yarn"},{"cmd":"pnpm add bot-middleware-jubi","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required for database operations (storing conversations, user data).","package":"mongodb","optional":false},{"reason":"Required only if cluster mode is enabled.","package":"redis","optional":true}],"imports":[{"note":"This package is CommonJS only; ES module import will fail.","wrong":"import { Server } from 'bot-middleware-jubi';","symbol":"Server","correct":"const { Server } = require('bot-middleware-jubi');"},{"note":"Direct destructuring works; accessing as property also valid.","wrong":"const facebook = require('bot-middleware-jubi').facebook;","symbol":"facebook","correct":"const { facebook } = require('bot-middleware-jubi');"},{"note":"Used to scaffold adapter folders for API intents.","wrong":null,"symbol":"createAdapter","correct":"const { createAdapter } = require('bot-middleware-jubi');"}],"quickstart":{"code":"const { Server, facebook } = require('bot-middleware-jubi');\n\nServer({\n  root: 'https://yourdomain.com/path',\n  socketLocalPath: '/socket',\n  httpPort: 4000,\n  dbUri: 'mongodb://root:root@127.0.0.1:27017/mydb',\n  staticDirectory: __dirname + '/static',\n  adapterPath: '/adapter',\n  adapterDirectory: __dirname + '/adapter',\n  projectId: 'myproject_100911645983',\n  passphraseMiddleware: 'supersecret',\n  timeoutSeconds: 60\n}, () => {\n  facebook({\n    verificationToken: 'verify',\n    pageAccessToken: process.env.PAGE_ACCESS_TOKEN ?? '',\n    path: '/fb'\n  });\n  console.log('Server initialized');\n});","lang":"javascript","description":"Initializes a bot server with MongoDB, serves static files, and sets up Facebook Messenger webhook."},"warnings":[{"fix":"Use const { ... } = require('bot-middleware-jubi'); instead of import.","message":"Do not use ES module imports (import/export) with this package; it is CommonJS only and may cause runtime errors.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Ensure MongoDB is running and the URI is correct before calling Server().","message":"The dbUri must point to a running MongoDB instance; the package does not provide connection pooling warnings if the URI is invalid.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Check the latest documentation for replacement APIs if they are missing.","message":"The properties 'dashbotKey', 'fcmServerKey', and 'firebaseWebConfig' are optional but may be removed in a future version.","severity":"deprecated","affected_versions":"<=1.0.102"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use const { Server } = require('bot-middleware-jubi'); and ensure Node.js version supports CommonJS.","cause":"Using ES module import or incorrect destructuring.","error":"TypeError: Server is not a function"},{"fix":"Start MongoDB or update the dbUri with correct credentials and host.","cause":"MongoDB is not running or the dbUri is incorrect.","error":"MongoError: failed to connect to server [localhost:27017]"},{"fix":"Change the httpPort option to an available port or kill the process using port 4000.","cause":"Port 4000 is already in use by another process.","error":"Error: listen EADDRINUSE :::4000"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}