Skip to content
oRPC
Esc
navigateopen⌘Jpreview
On this page

v1.8.9

Request Validation Plugin docs

The Request Validation Plugin ensures that only valid requests are sent to your server. This is especially valuable for applications that depend on server-side validation.

You can simplify your frontend by removing heavy form validation libraries and relying on oRPC’s validation errors instead, since input validation runs directly in the browser and is highly performant.

export function ContactForm() {
  const [error, setError] = useState()

  const handleSubmit = async (form: FormData) => {
    try {
      const output = await client.someProcedure(parseFormData(form))
      console.log(output)
    }
    catch (error) {
      setError(error)
    }
  }

  return (
    <form action={handleSubmit}>
      <input name="user[name]" type="text" />
      <span>{getIssueMessage(error, 'user[name]')}</span>

      <input name="user[emails][]" type="email" />
      <span>{getIssueMessage(error, 'user[emails][]')}</span>

      <button type="submit">Submit</button>
    </form>
  )
}

[!NOTE] If you find oRPC valuable and would like to support its development, you can do so here.

   🚀 Features

   🐞 Bug Fixes

  • contract: Cannot be named without a reference AsyncIteratorClass  -  by @dinwwwh (c68ce)
    View changes on GitHub

Last updated on September 15, 2025

Was this page helpful?