oRPC is a powerful combination of RPC and OpenAPI, makes it easy to build APIs that are end-to-end type-safe and adhere to OpenAPI standards
You can find the full documentation here.
Consume your API on the client with type-safety. Read the documentation for more information.
import { createORPCClient } from '@orpc/client' import { RPCLink } from '@orpc/client/fetch' import { ContractRouterClient } from '@orpc/contract' import { RouterClient } from '@orpc/server' const link = new RPCLink({ url: 'http://localhost:3000/rpc', headers: () => ({ authorization: 'Bearer token', }), // fetch: <-- provide fetch polyfill fetch if needed }) // Create a client for your router const client: RouterClient<typeof router> = createORPCClient(link) // Or, create a client using a contract const client: ContractRouterClient<typeof contract> = createORPCClient(link)
Distributed under the MIT License. See LICENSE for more information.
Share feedback Package Sidebar Install Downloads Weekly Downloads CollaboratorsRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4