{"id":29897640,"url":"https://github.com/green-api/greenapi-integration-rocketchat","last_synced_at":"2026-05-18T10:08:21.104Z","repository":{"id":303375526,"uuid":"907679796","full_name":"green-api/greenapi-integration-rocketchat","owner":"green-api","description":"This integration enables WhatsApp communication in Rocket.Chat using the GREEN-API platform. ","archived":false,"fork":false,"pushed_at":"2025-07-08T12:02:12.000Z","size":6386,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-29T00:43:43.695Z","etag":null,"topics":["green-api","nestjs","rocketchat","rocketchat-app"],"latest_commit_sha":null,"homepage":"https://green-api.com/en","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/green-api.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-12-24T06:17:26.000Z","updated_at":"2025-07-08T12:02:15.000Z","dependencies_parsed_at":"2025-07-07T09:46:53.200Z","dependency_job_id":"455089ab-d75b-49a2-99a4-05bb20e68f57","html_url":"https://github.com/green-api/greenapi-integration-rocketchat","commit_stats":null,"previous_names":["green-api/greenapi-integration-rocketchat"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/green-api/greenapi-integration-rocketchat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/green-api%2Fgreenapi-integration-rocketchat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/green-api%2Fgreenapi-integration-rocketchat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/green-api%2Fgreenapi-integration-rocketchat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/green-api%2Fgreenapi-integration-rocketchat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/green-api","download_url":"https://codeload.github.com/green-api/greenapi-integration-rocketchat/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/green-api%2Fgreenapi-integration-rocketchat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33174091,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T09:27:30.708Z","status":"ssl_error","status_checked_at":"2026-05-18T09:27:28.300Z","response_time":71,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["green-api","nestjs","rocketchat","rocketchat-app"],"created_at":"2025-08-01T10:19:28.997Z","updated_at":"2026-05-18T10:08:21.086Z","avatar_url":"https://github.com/green-api.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GREEN-API Integration with Rocket.Chat\n\n- [Документация на русском языке](./README.ru.md)\n\nThis integration enables WhatsApp communication in Rocket.Chat using the GREEN-API platform. Built on\nthe [Universal Integration Platform](https://github.com/green-api/greenapi-integration) by GREEN-API, it consists of two\nparts:\n\n1. The adapter service - A NestJS application that handles communication between Rocket.Chat and GREEN-API\n2. The Rocket.Chat app - A companion app that provides slash commands for managing the integration\n\n## Architecture\n\n### Adapter Service\n\nA NestJS application that:\n\n- Handles message transformation between Rocket.Chat and WhatsApp\n- Manages GREEN-API instances\n- Handles user authentication and command processing\n- Provides webhook endpoints for both platforms\n\n### Rocket.Chat App\n\nA Rocket.Chat application that provides slash commands:\n\nFor administrators:\n\n- `/greenapi.register-workspace` - Register your Rocket.Chat workspace\n- `/greenapi.list-instances` - List all instances in the workspace\n- `/greenapi.list-users` - List all registered users in the workspace\n- `/greenapi.sync-app-url` - Synchronize webhook URLs of all instances with the current app URL\n\nFor livechat agents:\n\n- `/greenapi.register-agent` - Register yourself as a livechat agent\n- `/greenapi.create-instance` - Create a new GREEN-API instance\n- `/greenapi.update-token` - Update Rocket.Chat authentication token\n\nFor both roles:\n\n- `/greenapi.remove-instance` - Admins can remove any instances, agents can only remove their own instances\n\n## Prerequisites\n\n- MySQL database (5.7 or higher)\n- Node.js 20 or higher\n- GREEN-API account and instance\n- Rocket.Chat server (self-hosted or cloud version)\n\n## Installation\n\n### Setting up the Adapter\n\n1. Clone the repository:\n\n```bash\ngit clone https://github.com/green-api/greenapi-integration-rocketchat.git\ncd greenapi-integration-rocketchat\n```\n\n2. Install dependencies:\n\n```bash\nnpm install\n```\n\n3. Set up environment variables in `.env`:\n\n```env\nDATABASE_URL=mysql://user:password@localhost:3306/rocket_adapter\nAPP_URL=https://your-domain.com\n```\n\n4. Apply migrations:\n\n```bash\nnpx prisma migrate deploy\n```\n\n5. Build and start the adapter:\n\n```bash\n# Build the application\nnpm run build\n\n# Start in production mode\nnpm run start:prod\n```\n\n### Installing the Rocket.Chat App\n\n1. Go to Rocket.Chat administration panel\n2. Navigate to Apps -\u003e Private Apps -\u003e Upload Private App\n3. Select the `greenapi_X.X.X.zip` file inside the `greenapi-integration-rocketchat-app/app`\n   project folder and upload it.\n4. Configure the app URL in settings to point to your adapter instance\n5. You can now use all the aforementioned commands.\n\n## Deployment\n\nThe adapter can be deployed using Docker Compose. Configuration files:\n\n### Docker Compose Setup\n\n```yaml\nversion: '3.8'\n\nservices:\n  adapter:\n    build: .\n    ports:\n      - \"3000:3000\"\n    environment:\n      - DATABASE_URL=${DATABASE_URL}\n      - APP_URL=${APP_URL}\n    depends_on:\n      - db\n\n  db:\n    image: mysql:8\n    environment:\n      - MYSQL_ROOT_PASSWORD=root_password\n      - MYSQL_USER=user\n      - MYSQL_PASSWORD=password\n      - MYSQL_DATABASE=rocket_adapter\n    volumes:\n      - mysql_data:/var/lib/mysql\n\nvolumes:\n  mysql_data:\n```\n\n### Dockerfile\n\n```dockerfile\nFROM node:20-alpine\nWORKDIR /app\nRUN apk add --no-cache openssl\nCOPY package*.json ./\nRUN npm ci\nCOPY . .\nRUN npx prisma generate\nRUN npm run build\nEXPOSE 3000\nCMD npx prisma migrate deploy \u0026\u0026 npm run start:prod\n```\n\nTo deploy using Docker Compose:\n\n```bash\n# Start all services\ndocker-compose up -d\n\n# Check logs\ndocker-compose logs -f\n\n# Stop all services\ndocker-compose down\n```\n\nNote: The deployment configuration is provided as a reference and may need adjustments based on your specific\nenvironment and requirements.\n\n## Important Notes\n\n### User Roles and Permissions\n\nThe integration uses Rocket.Chat's role system:\n\n1. **Administrator Role**\n    - Can register workspaces\n    - Can view all instances and users in the workspace\n    - Can remove any instance\n    - Can synchronize app URLs\n    - No need to register as an agent to use admin commands\n\n2. **Livechat Agent Role**\n    - Must register themselves first using `/greenapi.register-agent`\n    - Can create their own instances\n    - Can update their authentication token\n    - Can remove only their instances\n\n### How to Get Your Rocket.Chat Credentials\n\nTo obtain your `rocket-chat-id` and `rocket-chat-token`:\n\n1. Click your avatar in Rocket.Chat\n2. Go to \"Personal Access Tokens\" under Account settings\n3. Enter a name for your token or leave it blank and click \"Add\"\n4. After verification, you will be shown both your User ID and Access Token\n    - Save both values immediately as the token will only be shown once\n    - The User ID is your `rocket-chat-id`\n    - The Access Token is your `rocket-chat-token`\n\nNote: For workspace registration (`/greenapi.register-workspace`), the user must have admin role. For agent\nregistration (`/greenapi.register-agent`), the livechat-agent role is required.\n\n### Self-Hosted Deployments\n\nIf you're deploying the adapter on your own server, the adapter requires a public\nURL (APP_URL) that is accessible from the internet. This is necessary for:\n\n- Receiving webhooks from GREEN-API\n- Allowing Rocket.Chat to communicate with the adapter\n\nFor self-hosted deployments, make sure to:\n\n1. Configure your network/firewall to allow incoming connections\n2. Set up a domain name or static IP\n3. Configure SSL/TLS for secure communication\n4. Set the APP_URL environment variable to your public URL\n\n### File Sharing Configuration\n\nFor agents to be able to send files to WhatsApp, you need to ensure that public file access is enabled in your\nRocket.Chat workspace. To configure this:\n\n1. Click ⋮ (three vertical dots) in the top left corner of the Rocket.Chat home page\n2. Click workspace\n3. Click settings at the bottom of the sidebar\n4. Search for \"File Upload\" and open it.\n5. Disable setting \"Protect Uploaded Files\"\n\nIf this setting remains enabled, agents will not be able to send files to WhatsApp contacts.\n\n### Setting Up Livechat Agents in Rocket.Chat\n\nBefore registering as an agent in this integration, users need to be set up as livechat agents in Rocket.Chat:\n\n1. Click ⋮ (three vertical dots) in the top left corner of the Rocket.Chat home page\n2. Go to Omnichannel\n3. Navigate to Agents section\n4. Search for the user by their username you want to make an agent\n5. Select the user and click \"Add agent\"\n\nOnly after a user is set up as a livechat agent in Rocket.Chat can they register as an agent in this integration using\nthe `/greenapi.register-agent` command. An agent will only receive incoming chats if they are available. If they are\nnot available, the chat will go to the next available agent. If there are no available agents, the chat will be in the\n\"Queued\" status and will need to be manually taken.\n\n### Message Quoting Behavior\n\nWhen using message quotes in Rocket.Chat:\n\n- Agents can quote customer messages from WhatsApp\n- If agents quote their own messages, these quotes won't be visible in WhatsApp, only the message itself.\n\n## App usage\n\n### 1. Register your workspace in the adapter (requires admin role):\n\n```\n/greenapi.register-workspace [rocket-chat-id] [rocket-chat-token]\n```\n\n- `rocket-chat-id`: Your Rocket.Chat ID\n- `rocket-chat-token`: Your Rocket.Chat personal API token\n\n### 2. Register users in your workspace:\n\n```\n/greenapi.register-agent [rocket-chat-id] [rocket-chat-token]\n```\n\n- `rocket-chat-id`: User's Rocket.Chat ID\n- `rocket-chat-token`: User's Rocket.Chat personal API token\n\nThis command requires:\n\n- The workspace to be registered first\n- The user to have the livechat-agent role\n\n**For an agent to have an ability to answer in a WhatsApp chat, they must be registered through this command first.**\n\n### 3. Create a GREEN-API instance:\n\n```\n/greenapi.create-instance [instance-id] [instance-token]\n```\n\n- `instance-id`: Your GREEN-API instance ID\n- `instance-token`: Your GREEN-API instance API token\n\n### 4. Wait for settings:\n\nWait approximately 2 minutes for the instance settings to apply.\n\n### 5. Test the connection:\n\nWrite a message to a WhatsApp number connected to your GREEN-API instance - a new chat with\nthe message will appear in Rocket.Chat.\n\n### 6. Start messaging:\n\nYou can now use WhatsApp in Rocket.Chat!\n\n### Other available commands:\n\nFor agents:\n\n```\n# Create a new instance\n/greenapi.create-instance [instance-id] [instance-token]\n\n# Remove your own instance\n/greenapi.remove-instance [instance-id]\n\n# Update your authentication token\n/greenapi.update-token [rocket-chat-id] [new-rocket-chat-token]\n```\n\nFor admins:\n\n```\n# List all instances in workspace\n/greenapi.list-instances\n\n# List all registered agents\n/greenapi.list-users\n\n# Remove any instance\n/greenapi.remove-instance [instance-id]\n\n# Sync app URL for all instances\n/greenapi.sync-app-url [new-app-url]\n```\n\nThe sync-app-url command is particularly useful when you've changed your adapter's URL or moved it to a different\ndomain. It automatically updates the webhook URL settings for all your registered GREEN-API instances. Note: Your new\napp URL must end with \"api/webhook/rocket\" for proper webhook mapping.\n\n## License\n\nLicensed\nunder [Creative Commons Attribution-NoDerivatives 4.0 International (CC BY-ND 4.0)](https://creativecommons.org/licenses/by-nd/4.0/).\n\n[LICENSE](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreen-api%2Fgreenapi-integration-rocketchat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgreen-api%2Fgreenapi-integration-rocketchat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreen-api%2Fgreenapi-integration-rocketchat/lists"}