createORPCClient
createORPCClient(link, options?) creates a proxy object that mirrors your router’s shape. Every property access on the proxy builds up a path, and calling the resulting function dispatches a request through the provided link.
Type parameter
PassRouterClient<typeof router> (from @orpc/server) as the type argument so TypeScript can infer exact input, output, and error types for every procedure.
Calling procedures
The proxy mirrors your router shape. Property accesses are chainable, and the final call sends the request:Base path option
If you only want to expose a subset of your router, pass apath option:
createSafeClient
createSafeClient(client) wraps every procedure call in the safe() helper so that calls never throw. Instead they return a SafeResult tuple — or object — with error, data, isDefined, and isSuccess fields.
isDefined and typed errors.
The .func pattern
Because the client is aProxy, calling .call on a procedure utils gives you the underlying function directly — useful when passing it to higher-order utilities:
