Skip to content

frmoretto/Hubspot-Whatsapp-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HubSpot WhatsApp Integration

A Node.js application that integrates HubSpot with WhatsApp, providing OAuth-based authentication and secure message handling.

Features

  • HubSpot OAuth 2.0 Authentication
  • Secure Token Management
  • WhatsApp Message Integration
  • File Attachment Support
  • Contact Synchronization

Prerequisites

  • Node.js 18 or higher
  • npm or yarn
  • HubSpot Developer Account
  • Valid HubSpot App credentials

Installation

  1. Clone the repository
git clone https://github.com/your-username/hubspot-whatsapp-app.git
cd hubspot-whatsapp-app
  1. Install dependencies
npm install
  1. Create environment file
cp .env.example .env
  1. 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

Development

Start the development server:

npm run dev

Build for production:

npm run build

Start production server:

npm start

OAuth Flow

  1. Visit /oauth/authorize to start the OAuth flow
  2. User will be redirected to HubSpot for authorization
  3. After approval, HubSpot redirects back to /oauth/callback
  4. Access token and refresh token are securely stored

API Endpoints

  • GET /oauth/authorize - Start OAuth flow
  • GET /oauth/callback - OAuth callback handler
  • POST /oauth/refresh - Refresh access token
  • POST /oauth/revoke - Revoke access
  • GET /health - Health check endpoint

Security

  • All tokens are encrypted using AES-256-GCM
  • CSRF protection implemented
  • State parameter validation
  • Regular token rotation
  • Secure storage of credentials

Scripts

  • npm run dev - Start development server
  • npm run build - Build for production
  • npm start - Start production server
  • npm test - Run tests
  • npm run lint - Run linter
  • npm run format - Format code

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/awesome-feature)
  3. Commit your changes (git commit -m 'Add awesome feature')
  4. Push to the branch (git push origin feature/awesome-feature)
  5. Open a Pull Request

License

This project is licensed under the ISC License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published