FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
project logo
charmaineEnrich-New-User
Get enriched new user data notifications
Public
Like
Enrich-New-User
Home
Code
2
README.md
H
main.tsx
Branches
1
Pull requests
Remixes
History
Environment variables
3
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.
Sign up now
Code
/
Code
/
Search
main.tsx
https://charmaine--9c584c0a5dbf11f08db60224a6c84d84.web.val.run
README.md

Clay API for New User Enrichment

Clay doesn't offer an API, but you can simulate an API via Val Town by listening to webhooks, enriching data in Clay, and having Clay send an HTTP request back when enrichment is complete.

This demo uses Clay like an API to automatically enrich new user signups and send notifications to Discord.

Here's an example: Screenshot 2025-07-11 at 2.56.21 PM.png

Here's the underlying Clay Table (feel free to zoom in to see the exact setup for debugging): CleanShot 2025-07-23 at 10.50.53@2x.png

1. Set up your Clay table and webhook

  1. Create a new Clay workbook called "New User Enrichment"

  2. Click Add → Pull in data from source at the bottom

  3. Select Pull in data from a Webhook Table

  4. Click Edit source on the Webhook column to copy the webhook URL Screenshot 2025-07-11 at 3.24.16 PM.png

  5. Update the webhook URL in your main.tsx file:

"https://api.clay.com/v3/sources/webhook/pull-in-data-from-a-webhook-YOUR_ID"

Note: Setting up the webhook like this lets you transform / filter the data before sending it over to Clay. It also helps with error handling and give you logs in Val Town for observability. Otherwise, you could set up the webhook directly from the source ie. Clerk, Stripe etc.

2. Add enrichment columns to Clay

Add whichever enrichment columns you want. This example uses:

  • Enrich Person → Name, Title, Org
  • LinkedIn Profile → LinkedIn URL

3. Make HTTP request from Clay

  1. Click Add Column → Add Enrichment → search for HTTP API
  2. Add HTTP API column to your Clay table
  3. Click Edit Column and fill in the following:
  • Set endpoint to your HTTP URL: https://your-val-url.com/clayEnrichmentWebhook (Note: you need the /clayEnrichmentWebhook!)
  • Set method: POST
  • Configure request body:
{ "email": "{{email}}", "profile_image_url": "{{profile_image_url}}", "Name": "{{name}}", "Title": "{{title}}", "Org": "{{org}}", "LinkedIn": "{{LinkedIn Profile}}" }
  • Enable Remove empty values
  • Here's what my final column looked like:
  • Screenshot 2025-07-11 at 2.44.27 PM.png

4. Add environment variables in Val Town

  1. Click Environment Variables in your val's sidebar
  2. Add: DISCORD_WEBHOOK_URL with your Discord webhook URL

5. Configure your source webhook

This is what triggers a new row in the Clay table, hook up your source system (Clerk, Stripe, etc.) to send webhooks to your val's HTTP URL: https://your-val-url.com/newUserSignup (Note: you need the /newUserSignup!)

For Clerk, you can find it here: image.png

Output

Enriched profiles (with ⭐):

⭐ New user! John Doe • Software Engineer @ Tech Corp • john@example.com • https://linkedin.com/in/johndoe

Basic signups:

New user! user@example.org • [profile_image_url]
HTTP
  • main.tsx
    charmaine--9c584c0a5dbf11f08db60224a6c84d84.web.val.run
Code
README.md
H
main.tsx
Go to top
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Product
FeaturesPricing
Developers
DocsStatusAPI ExamplesNPM Package Examples
Explore
ShowcaseTemplatesNewest ValsTrending ValsNewsletter
Company
AboutBlogCareersBrandhi@val.town
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.