Public
Like
1
new-user-enrichment
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: v19View latest version
Enrich new user data with a webhook and post results to Slack
- Your application sends a request to this webhook with a user's email address.
- This webhook uses the Val Town Clay Proxy to enrich the user data with information like their LinkedIn profile, company name, company size, funding state, total funding, and more.
- The data is passed to Chat GPT for lead scoring
- The results are sent to your own Slack webhook
- Remix this val
- Create a custom Slack app with an incoming webhook and add its URL as
SLACK_WEBHOOK_URL. See the docs for Sending Slack messages for more info. - Use
webhook.test.tsto test that your enrichment works. You should see a message in your Slack channel. - In your own application, add logic to send a request to this webhook when new users sign up.
This val uses Clay under the hood to provide user-enrichment data. The Val Town Clay Proxy is only available to paying Val Town Team accounts. To sign up to use this val, please send an email to mailto:enrichment@val.town.
To make this more secure, you can optionally set a WEBHOOK_SECRET environment variable and only accept requests that use the secret when posting.
// Add this to `main.ts` to only accept requests that include the secret
const secret = req.headers.get("Authorization");
if (secret !== `Bearer ${Deno.env.get("WEBHOOK_SECRET")}`) {
return new Response("Unauthorized", {
status: 401,
});
}