npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

twenty-migrate-hubspot

v1.0.0

Published

CLI migration tool for HubSpot to Twenty CRM

Readme

Twenty HubSpot Migration Tool

CLI migration tool for HubSpot to Twenty CRM.

Installation

npm install -g twenty-migrate-hubspot

Usage

Basic Migration

twenty-migrate-hubspot \
  --source-key YOUR_HUBSPOT_API_KEY \
  --twenty-url http://localhost:3000 \
  --twenty-key YOUR_TWENTY_API_KEY

Dry Run (Preview)

twenty-migrate-hubspot \
  --source-key YOUR_HUBSPOT_API_KEY \
  --twenty-url http://localhost:3000 \
  --twenty-key YOUR_TWENTY_API_KEY \
  --dry-run

Select Objects

twenty-migrate-hubspot \
  --source-key YOUR_HUBSPOT_API_KEY \
  --twenty-url http://localhost:3000 \
  --twenty-key YOUR_TWENTY_API_KEY \
  --objects contacts,companies

Features

  • HubSpot API Integration - Official SDK for data extraction
  • Paginated Extraction - Handle large datasets efficiently
  • Schema Mapping - HubSpot → Twenty CRM field mapping
  • Batch Processing - Process records in configurable batches
  • Progress Tracking - Real-time migration progress
  • Dry Run Mode - Preview migration without changes
  • Error Handling - Detailed error logging and recovery
  • Duplicate Prevention - Check for existing records

Migration Mapping

| HubSpot | Twenty | |---------|--------| | contacts → firstname, lastname, email, phone | people → name, email, phone | | companies → name, domain, industry | companies → name, domainName, industry | | deals → dealname, amount, closedate, pipeline | opportunities → name, amount, closeDate | | notes → hs_note_body, associations | notes → body + person/company links |

What Migrates

Supported Objects:

  • Contacts → People (name, email, phone, lifecycle stage)
  • Companies → Companies (name, domain, industry, description)
  • Deals → Opportunities (name, amount, close date, pipeline)
  • Notes → Notes (body, associations to contacts/companies)

What Doesn't Migrate:

  • Email history and threads
  • File attachments
  • Custom properties (partially supported)
  • Sequences and workflows
  • Users and owners
  • Activity history
  • Lists and segments

Command Line Options

Options:
  -k, --source-key <key>      HubSpot API key (required)
  -u, --twenty-url <url>      Twenty CRM URL (required)
  -t, --twenty-key <key>      Twenty CRM API key (required)
  -d, --dry-run              Preview migration without writing data
  -o, --objects <objects>    Objects to migrate (comma-separated)
  -b, --batch <number>        Batch size for API calls (default: 60)
  -h, --help                 Show help
  -v, --version              Show version

Environment Variables

Create a .env file:

# HubSpot API Configuration
HUBSPOT_API_KEY=your_hubspot_api_key_here
HUBSPOT_API_URL=https://api.hubapi.com

# Twenty CRM Configuration
TWENTY_URL=http://localhost:3000
TWENTY_API_KEY=your_twenty_api_key_here

# Migration Settings
BATCH_SIZE=60
RATE_LIMIT_DELAY=600
DRY_RUN=false
OBJECTS=contacts,companies,deals,notes

Rate Limiting

  • HubSpot API: 100 requests per minute
  • Automatic delay: 600ms between requests
  • Batch processing: 60 records per batch
  • Retry mechanism: Automatic retry on failures

Reports

Migration Report

{
  "timestamp": "2026-04-04T14:30:00.000Z",
  "migration": {
    "tool": "twenty-migrate-hubspot",
    "version": "1.0.0",
    "objects": ["contacts", "companies", "deals", "notes"],
    "dryRun": false
  },
  "summary": {
    "total": 1000,
    "success": 985,
    "errors": 15,
    "successRate": "98.50%"
  },
  "objectResults": {
    "people": {
      "attempted": 500,
      "success": 495,
      "errors": 5,
      "successRate": "99.00%"
    },
    "companies": {
      "attempted": 200,
      "success": 198,
      "errors": 2,
      "successRate": "99.00%"
    },
    "opportunities": {
      "attempted": 150,
      "success": 147,
      "errors": 3,
      "successRate": "98.00%"
    },
    "notes": {
      "attempted": 150,
      "success": 145,
      "errors": 5,
      "successRate": "96.67%"
    }
  },
  "errors": [],
  "recommendations": []
}

Error Log

Batch 1 (people): Duplicate email detected - [email protected]
Batch 2 (companies): Invalid industry format - "Tech & IT"
Batch 3 (opportunities): Invalid amount format - "$50,000"

Examples

Large Dataset Migration

twenty-migrate-hubspot \
  --source-key pat_1234567890 \
  --twenty-url https://your-company.twenty.com \
  --twenty-key twenty_api_key_1234567890 \
  --batch 30 \
  --objects contacts,companies

Test Migration

twenty-migrate-hubspot \
  --source-key pat_1234567890 \
  --twenty-url http://localhost:3000 \
  --twenty-key twenty_api_key_1234567890 \
  --dry-run \
  --objects contacts

Development

# Clone repository
git clone https://github.com/deliveredbyai/twenty-migrate-hubspot.git
cd twenty-migrate-hubspot

# Install dependencies
npm install

# Build project
npm run build

# Run tests
npm test

# Start development
npm run dev

Contributing

  1. Fork the repository
  2. Create feature branch
  3. Make your changes
  4. Run tests
  5. Submit pull request

License

MIT License - see LICENSE file for details.

Troubleshooting

Common Issues

"HubSpot API connection failed"

  • Check API key validity
  • Verify HubSpot account permissions
  • Ensure API key has proper scopes

"Rate limit exceeded"

  • Increase batch size delay
  • Reduce concurrent requests
  • Check HubSpot API limits

"Duplicate records"

  • Tool automatically prevents duplicates
  • Check existing data in Twenty CRM
  • Use dry-run to preview duplicates

"Invalid field mapping"

  • Review field mapping table
  • Check HubSpot field names
  • Verify Twenty CRM field requirements

Support

Acknowledgments