@openpolicy/plus
v0.0.5
Published
A typed client SDK for the OpenPolicy Plus API, powered by [oRPC](https://orpc.dev/).
Readme
@openpolicy/plus
A typed client SDK for the OpenPolicy Plus API, powered by oRPC.
Installation
npm install @openpolicy/plusUsage
Low-level client
import { createPlusClient } from "@openpolicy/plus";
const client = createPlusClient("https://your-app.com");
const result = await client.hello();
console.log(result.message); // "Hello from oRPC!"Convenience helpers
import { hello } from "@openpolicy/plus";
const result = await hello("https://your-app.com");
console.log(result.message);API
createPlusClient(baseUrl: string)
Creates a fully-typed oRPC client bound to the given base URL. All procedures from AppRouter are available as async methods.
hello(baseUrl: string): Promise<{ message: string }>
Calls the hello procedure and returns the response.
