Hi all,
Has anyone had success using private packages in HubSpot UI extensions? We have some common libraries we’d like to utilize but I can’t find out how to make it work. Open to all suggestions and thank you so much!
- Tamzin
Hi all,
Has anyone had success using private packages in HubSpot UI extensions? We have some common libraries we’d like to utilize but I can’t find out how to make it work. Open to all suggestions and thank you so much!
- Tamzin
Hi, @Tamzin
Thanks for your question. I tried to find some posts related to your question but didn’t have much luck. I’d like to invite some community members to the converstaion — hey @zach_threadint @Anton @evaldas have you tried anything similar in your own work?
Thank you very much for taking a look! — Jaycee
My team ran into the same thing. We tried several approaches to use our private npm packages (including hardcoded access keys and different registry configs), but HubSpot’s build never successfully resolved or deployed when it had to pull from our private registry.
What we did instead: Added a small sync script that runs before upload. It installs our private package locally (using our CI token), copies the package contents into a folder inside the project, then removes that dependency from package.json and runs npm install again. So by the time we run `hs project upload`, everything HubSpot needs is already in the repo, no private registry is involved in their build. Our single source of truth is still the npm package; the script just “inlines” it for HubSpot.
HubSpot also supports sharing code between extensions via npm workspaces (no private registry required, shared code lives inside your project). If your shared code can live in the repo, that’s the supported path.