@tomers/openapp-sdk
v0.1.61
Published
Official TypeScript SDK for OpenApp — Physical Security as a Service (PSaaS): API-first access control for doors, gates, intercom, invitations, and audit.
Maintainers
Readme
@tomers/openapp-sdk
Official TypeScript SDK for OpenApp — Physical Security as a Service (PSaaS): API-first access control for doors, gates, virtual intercom, guest invitations, policies, and audit.
- Docs: openapp.house/docs/sdk/typescript
- Agents: Agents & automation
- OpenAPI: openapp-openapi.json
Installation
npm install @tomers/openapp-sdkRequirements
- Node.js 20+
- OpenApp API key
Quick start
import { AsyncClient } from "@tomers/openapp-sdk";
const client = new AsyncClient(process.env.OPENAPP_API_KEY!);
try {
const orgs = await client.orgs.list();
console.log(orgs);
} finally {
client.close();
}Basic operations
import { AsyncClient } from "@tomers/openapp-sdk";
const client = new AsyncClient(process.env.OPENAPP_API_KEY!);
const created = await client.orgs.create("Example Org");
const org = await client.orgs.get("org_123");
const devices = await client.devices.list("org_123");
const plan = await client.billing.plan("org_123");
const invites = await client.me.invitations();
client.close();Error handling
import { AsyncClient, ApiError, AuthError } from "@tomers/openapp-sdk";
const client = new AsyncClient(process.env.OPENAPP_API_KEY!);
try {
await client.orgs.list();
} catch (err) {
if (err instanceof AuthError) {
console.error("Authentication failed:", err.message);
} else if (err instanceof ApiError) {
console.error("API error:", err.message, err.code);
} else {
console.error("Unexpected error:", err);
}
} finally {
client.close();
}TypeScript API types
The package exports OpenAPI-aligned TypeScript types in addition to the runtime client:
import type { paths } from "@tomers/openapp-sdk";