Unlisted
Like
leads
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.
AI-powered lead qualifying from any data source.
- Send an HTTP
POSTrequest tomain.ts - Include any lead data you have
- name
- company
- anything else
main.tsforwards the request data to the AI agent inagent.ts- The agent:
- reads your qualification rules from
PROMPT.txt - uses web search to gather more context if needed
- decides whether the lead matches your criteria
- reads your qualification rules from
- The agent returns a normalized, predictable JSON response:
{ "name": "(normalized name)", "match": true, "reasoning": "(why this lead does or does not match)" }
- Click Remix
- Save your
OPENAI_API_KEYas an environment variable - Customize
PROMPT.txt(Don't remove any fields from the structured response) - Get the val's HTTP endpoint from
main.ts: - Start forwarding leads to this webhook from any source as a POST request.
- That's it! You now have a growing
leadsSQLite table with one column for your originalinput_dataand a second column for the AI evaluator'soutput_data. You also have a dashboard of this data hosted at themain.tsval endpoint.
- You can add any number of fields to the AI's output instructions in
PROMPT.txtand they'll be added tooutput_data. You can use this to expand the AI's assessment, enrich your leads, or even just normalize lead data coming from different sources. - You can also add query parameters when you POST to the val endpoint. (ex:
your-val-endpoint.val.run?source=signup-page). The parameters will be bundled in the_queryobject ofinput_data. This can be useful for tracking where a lead was forwarded from.