A Node.js application that integrates HubSpot with WhatsApp, providing OAuth-based authentication and secure message handling.
- HubSpot OAuth 2.0 Authentication
- Secure Token Management
- WhatsApp Message Integration
- File Attachment Support
- Contact Synchronization
- Node.js 18 or higher
- npm or yarn
- HubSpot Developer Account
- Valid HubSpot App credentials
- Clone the repository
git clone https://github.com/your-username/hubspot-whatsapp-app.git
cd hubspot-whatsapp-app- Install dependencies
npm install- Create environment file
cp .env.example .env- Configure environment variables in
.env:
HUBSPOT_CLIENT_ID=your_client_id
HUBSPOT_CLIENT_SECRET=your_client_secret
HUBSPOT_REDIRECT_URI=http://localhost:3000/oauth/callback
ENCRYPTION_KEY=your_32_byte_encryption_key
Start the development server:
npm run devBuild for production:
npm run buildStart production server:
npm start- Visit
/oauth/authorizeto start the OAuth flow - User will be redirected to HubSpot for authorization
- After approval, HubSpot redirects back to
/oauth/callback - Access token and refresh token are securely stored
GET /oauth/authorize- Start OAuth flowGET /oauth/callback- OAuth callback handlerPOST /oauth/refresh- Refresh access tokenPOST /oauth/revoke- Revoke accessGET /health- Health check endpoint
- All tokens are encrypted using AES-256-GCM
- CSRF protection implemented
- State parameter validation
- Regular token rotation
- Secure storage of credentials
npm run dev- Start development servernpm run build- Build for productionnpm start- Start production servernpm test- Run testsnpm run lint- Run linternpm run format- Format code
- Fork the repository
- Create your feature branch (
git checkout -b feature/awesome-feature) - Commit your changes (
git commit -m 'Add awesome feature') - Push to the branch (
git push origin feature/awesome-feature) - Open a Pull Request
This project is licensed under the ISC License.