Public
Like
enrich-new-users-slack
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v28View latest version
Demo showing how to enrich new user signups from a Hubspot Form.
The data passes from Hubspot form -> Hubspot webhook (new contact creation) -> Clay for enrichment -> send notifications to Slack.
slack.ts- Send Slack notificationtest.ts- Test script to simulate new user sign upwebhook.ts- Receives webhooks when you get a new user
As of Aug 2025, Apps on Hubspot's new developer platform need to be done via the CLI
- Install the HubSpot CLI with these instructions
- Here were the steps that worked for me:
npm install -g @hubspot/cli@latesths account authhs project createfor anApp, withPrivatedistribution,Static AuthandWebhooks
- Here were the steps that worked for me:
- In your new
src/appdirectory, addwebhooks/webhook-hsmeta.jsonwith the following config. Note: Swap out thetargetUrlwith your Val Town HTTP endpoint URl from./webhook.ts.
{
"uid": "webhooks",
"type": "webhooks",
"config": {
"settings": {
"targetUrl": "https://charmaine--0199720fd819701cb2e80be3c8cff217.web.val.run",
"maxConcurrentRequests": 10
},
"subscriptions": {
"crmObjects": [
{
"subscriptionType": "object.propertyChange",
"objectType": "contact",
"propertyName": "email",
"active": true
}
]
}
}
}
- Remix this val
- Get a Slack webhook
& set it as
SLACK_WEBHOOK_URLin this val's Environment variables in the left sidebar - Get a random token & set it to
VAL_WEBHOOK_SECRETin this val's Environment variables in the left sidebar - Click run on
test.tsto see the complete flow (takes up to 5 minutes to enrich) - Check your Slack channel for the enriched user notification
- Set your auth system (ie Clerk) to send new user webhooks to
webhook.ts
Clay is a user-enrichment tool that allows you to leverage the data of hundreds of enrichment services.
We at Val Town have set up a basic Clay enrichment table that finds basic user info from email address or github username – and have created a synthetic API to it, which this val calls. Clay costs money, so proxy is only available to paid Val Town Teams accounts.