Skip to content
This repository has been archived by the owner on Mar 10, 2024. It is now read-only.

feat: implement hubspot webhook target endpoint + webhook setup #2040

Merged
merged 10 commits into from
Dec 11, 2023

Conversation

asdfryan
Copy link
Contributor

@asdfryan asdfryan commented Dec 7, 2023

  • Create webhook target on Provider creation
  • Create / update webhook subscriptions on SyncConfig update

Copy link

vercel bot commented Dec 7, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
management-ui ⬜️ Ignored (Inspect) Visit Preview Dec 11, 2023 6:54pm
supaglue-docs ⬜️ Ignored (Inspect) Visit Preview Dec 11, 2023 6:54pm

import { BadRequestError } from '../errors';

const HUBSPOT_WEBHOOK_TARGET_URL =
process.env.HUBSPOT_WEBHOOK_TARGET_URL ?? `${process.env.SUPAGLUE_SERVER_URL}/internal/hubspot/_webhook`;
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Comment on lines 54 to 56
throw new BadRequestError(
`Your Hubspot Developer App already has an existing Webhook target URL. Please delete it first.`
);
Copy link
Contributor

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?

packages/core/lib/hubspot_webhook.ts Outdated Show resolved Hide resolved
asdfryan and others added 2 commits December 11, 2023 10:09
Co-authored-by: Lucas Marshall <lucasmarshall@users.noreply.github.com>
Copy link
Contributor

@lucasmarshall lucasmarshall left a 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.

packages/core/lib/hubspot_webhook.ts Outdated Show resolved Hide resolved
Co-authored-by: Lucas Marshall <lucasmarshall@users.noreply.github.com>
@asdfryan asdfryan merged commit 7df24e1 into main Dec 11, 2023
11 checks passed
@asdfryan asdfryan deleted the hubspot_webhook branch December 11, 2023 18:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants