[READ-ONLY] Mirror of https://github.com/openstatusHQ/sdk-node. SDK for openstatus www.openstatus.dev

feat: Add createOpenStatusClient factory for reusable auth configuration (#10) master

Add a new `createOpenStatusClient(options)` factory function that allows users to configure authentication once and reuse it across all API calls, eliminating the need to pass headers on every request. Changes: - Add `OpenStatusClientOptions` interface with `apiKey` and `baseUrl` options - Add `createAuthInterceptor` to automatically inject auth headers - Add `createOpenStatusClient` factory function - Update README with new recommended usage pattern - Update all code examples to use the new client-based approach Usage: ```typescript const client = createOpenStatusClient({ apiKey: process.env.OPENSTATUS_API_KEY, }); // No headers needed on each call await client.monitor.v1.MonitorService.listMonitors({}); ``` The default `openstatus` export is preserved for backwards compatibility.


+504 -454
3 changed files