Back to packages list![browserbase avatar](https://img.clerk.com/eyJ0eXBlIjoicHJveHkiLCJzcmMiOiJodHRwczovL2ltYWdlcy5jbGVyay5kZXYvdXBsb2FkZWQvaW1nXzJsaUtERldpTHR5b1o1cnphRjVxMFlYcU5UcyJ9)
![stevekrouse avatar](https://images.clerk.dev/uploaded/img_2PqHa2Gsy93xQrjh2w78Xu0cChW.jpeg)
Vals using zod
Description from the NPM package:
TypeScript-first schema declaration and validation library with static type inference
TopHackerNewsDailyEmail
@browserbase
Cron
Browserbase Browserbase offers a reliable, high performance serverless developer platform to run, manage, and monitor headless browsers at scale. Leverage our infrastructure to power your web automation and AI agents. Get started with Browserbase for free here . If you have any questions, reach out to developer@browserbase.com.
![stevekrouse avatar](https://images.clerk.dev/uploaded/img_2PqHa2Gsy93xQrjh2w78Xu0cChW.jpeg)
zod_demo_http
@stevekrouse
HTTP (preview)
This val shows how to break up your HTTP val into three vals: @stevekrouse/zod_demo_http (this val) @stevekrouse/zod_demo_frontend (client-side react component) @stevekrouse/zod_demo_shared (code that is imported in both vals, but only run on the backend) I have these vals in a folder. Unfortunately, folders are not publicly shareable,
which is why I listed all the vals above. The Val Town full-screen editor makes it
a lot easier to work with multiple vals at once. The trickiest and most interesting part of this particular demo is how we import just the zod type
in the frontend which avoids the error
if we were to import any real value from that shared file. In this sense, it's not a truly safe
shared file. Open questions I don't know why zod types aren't working when imported via esm.sh I don't know how we would get zod validation working on the frontend without reimporting zod from esm.sh (which would then lose us types or require us to duplicate the zod code)