The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
basic hubspot app
Kiran K9e2bbea85f5f
diff --git a/apps/web/app/(ee)/api/hubspot/webhook/route.ts b/apps/web/app/(ee)/api/hubspot/webhook/route.tsnew file mode 100644index 0000000000..dc2484c7b1--- /dev/null+++ b/apps/web/app/(ee)/api/hubspot/webhook/route.ts@@ -0,0 +1,17 @@+import { handleAndReturnErrorResponse } from "@/lib/api/errors";+import { AxiomRequest, withAxiom } from "next-axiom";+import { NextResponse } from "next/server";++// POST /api/hubspot/webhook – listen to webhook events from Hubspot+export const POST = withAxiom(async (req: AxiomRequest) => {+ console.log("Received webhook from Hubspot")++ try {+ const rawBody = await req.text();+ console.log(rawBody)++ return NextResponse.json("OK");+ } catch (error) {+ return handleAndReturnErrorResponse(error);+ }+});\ No newline at end of filediff --git a/packages/hubspot-app/README.md b/packages/hubspot-app/README.mdindex 6eb242e586..0833c27e5a 100644--- a/packages/hubspot-app/README.md+++ b/packages/hubspot-app/README.md@@ -22,4 +22,7 @@ pnpm hs project dev# Install all project dependenciespnpm hs project install-deps++# Add new feature to app+pnpm hs project add```diff --git a/packages/hubspot-app/src/app/app-hsmeta.json b/packages/hubspot-app/src/app/app-hsmeta.jsonindex 58475af49f..35ed69581e 100644--- a/packages/hubspot-app/src/app/app-hsmeta.json+++ b/packages/hubspot-app/src/app/app-hsmeta.json@@ -7,20 +7,18 @@"distribution": "marketplace","auth": {"type": "oauth",- "redirectUrls": [- "http://localhost:3000"- ],+ "redirectUrls": ["http://localhost:3000/oauth-callback"],"requiredScopes": [+ "oauth","crm.objects.contacts.read",- "crm.objects.contacts.write"+ "crm.objects.contacts.write",+ "crm.objects.leads.read"],"optionalScopes": [],"conditionallyRequiredScopes": []},"permittedUrls": {- "fetch": [- "https://api.hubapi.com"- ],+ "fetch": ["https://api.hubapi.com"],"iframe": [],"img": []},@@ -31,4 +29,4 @@"supportPhone": "+18005555555"}}-}\ No newline at end of file+}diff --git a/packages/hubspot-app/src/app/webhooks/webhooks-hsmeta.json b/packages/hubspot-app/src/app/webhooks/webhooks-hsmeta.jsonindex 5aa51a8a4b..edb43fb7a7 100644--- a/packages/hubspot-app/src/app/webhooks/webhooks-hsmeta.json+++ b/packages/hubspot-app/src/app/webhooks/webhooks-hsmeta.json@@ -3,7 +3,7 @@"type": "webhooks","config": {"settings": {- "targetUrl": "https://example.com/webhook",+ "targetUrl": "https://accurate-caribou-strictly.ngrok-free.app/api/hubspot/webhook","maxConcurrentRequests": 10},"subscriptions": {@@ -14,29 +14,11 @@"active": true},{- "subscriptionType": "object.propertyChange",- "objectType": "contact",- "propertyName": "firstname",- "active": true- }- ],- "legacyCrmObjects": [- {- "subscriptionType": "contact.propertyChange",- "propertyName": "lastname",- "active": true- },- {- "subscriptionType": "contact.deletion",- "active": true- }- ],- "hubEvents": [- {- "subscriptionType": "contact.privacyDeletion",+ "subscriptionType": "object.creation",+ "objectType": "lead","active": true}]}}-}\ No newline at end of file+}