-
Notifications
You must be signed in to change notification settings - Fork 57
feat: implement hubspot webhook target endpoint + webhook setup #2040
Conversation
asdfryan
commented
Dec 7, 2023
- Create webhook target on Provider creation
- Create / update webhook subscriptions on SyncConfig update
… hubspot_provider
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Ignored Deployments
|
import { BadRequestError } from '../errors'; | ||
|
||
const HUBSPOT_WEBHOOK_TARGET_URL = | ||
process.env.HUBSPOT_WEBHOOK_TARGET_URL ?? `${process.env.SUPAGLUE_SERVER_URL}/internal/hubspot/_webhook`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When would you use HUBSPOT_WEBHOOK_TARGET_URL
instead of relying on the fallback?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When we use another service for queueing webhooks, like hookdeck.
packages/core/lib/hubspot_webhook.ts
Outdated
throw new BadRequestError( | ||
`Your Hubspot Developer App already has an existing Webhook target URL. Please delete it first.` | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe move this out of the try
so we aren't needlessly catching and re-throwing it?
Co-authored-by: Lucas Marshall <lucasmarshall@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nit, otherwise looks good.
Co-authored-by: Lucas Marshall <lucasmarshall@users.noreply.github.com>