@factorialco/api-client 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -57,11 +57,11 @@ Explicit options always take precedence.
57
57
  | Variable | Maps to option | Sent as |
58
58
  |----------|----------------|---------|
59
59
  | `FACTORIAL_API_KEY` | `apiKey` | `x-api-key` header |
60
- | `FACTORIAL_OAUTH_TOKEN` | `token` | `Authorization: Bearer` |
60
+ | `FACTORIAL_TOKEN` | `token` | `Authorization: Bearer` |
61
61
  | `FACTORIAL_BASE_URL` | `baseUrl` | — (defaults to `https://api.factorialhr.com`) |
62
62
 
63
63
  ```ts
64
- // No options needed — reads FACTORIAL_API_KEY / FACTORIAL_OAUTH_TOKEN / FACTORIAL_BASE_URL
64
+ // No options needed — reads FACTORIAL_API_KEY / FACTORIAL_TOKEN / FACTORIAL_BASE_URL
65
65
  const client = new FactorialClient();
66
66
  ```
67
67
 
package/dist/cjs/sdk.d.ts CHANGED
@@ -20,7 +20,7 @@ export type FactorialClientConfig = Omit<Partial<Config<ClientOptions>>, "baseUr
20
20
  /**
21
21
  * OAuth2 bearer token — sent as `Authorization: Bearer <token>`.
22
22
  * Use this when authenticating via OAuth2 instead of an API key.
23
- * Falls back to the `FACTORIAL_OAUTH_TOKEN` env var when omitted.
23
+ * Falls back to the `FACTORIAL_TOKEN` env var when omitted.
24
24
  */
25
25
  token?: string;
26
26
  };
package/dist/cjs/sdk.js CHANGED
@@ -5523,10 +5523,10 @@ class FactorialClient {
5523
5523
  globalThis.process.env
5524
5524
  : {};
5525
5525
  const resolvedApiKey = apiKey ?? env.FACTORIAL_API_KEY;
5526
- const resolvedToken = token ?? env.FACTORIAL_OAUTH_TOKEN;
5526
+ const resolvedToken = token ?? env.FACTORIAL_TOKEN;
5527
5527
  const resolvedBaseUrl = baseUrl ?? env.FACTORIAL_BASE_URL ?? "https://api.factorialhr.com";
5528
5528
  if (!resolvedApiKey && !resolvedToken) {
5529
- throw new Error("FactorialClient: provide either apiKey or token (or set FACTORIAL_API_KEY / FACTORIAL_OAUTH_TOKEN)");
5529
+ throw new Error("FactorialClient: provide either apiKey or token (or set FACTORIAL_API_KEY / FACTORIAL_TOKEN)");
5530
5530
  }
5531
5531
  // hey-api calls the auth callback once per security scheme in spec order:
5532
5532
  // 1. { type: 'http', scheme: 'bearer' } → Authorization: Bearer <token>