@xberg-io/sdk 0.6.0 → 0.8.0

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
@@ -48,9 +48,8 @@ pnpm add @xberg-io/sdk
48
48
 
49
49
  ## Targets
50
50
 
51
- `XbergClient` defaults to Xberg Enterprise (`baseUrl` defaults to
52
- `https://api.xberg.io`). To talk to a self-hosted Xberg Pro instance, pass
53
- `target: "pro"` with an explicit `baseUrl`:
51
+ Both products are self-hosted, so `XbergClient` requires the deployment's
52
+ `baseUrl`. Pass `target: "pro"` when the target is already known:
54
53
 
55
54
  ```ts
56
55
  import { XbergClient } from "@xberg-io/sdk";
@@ -68,7 +67,7 @@ or `login()` on Enterprise) throws a clear "not available on this tier" error.
68
67
  import { XbergClient } from "@xberg-io/sdk";
69
68
  import { readFile } from "node:fs/promises";
70
69
 
71
- const client = new XbergClient({ apiKey: process.env.XBERG_API_KEY! });
70
+ const client = new XbergClient({ baseUrl: "https://xberg.example.com", apiKey: process.env.XBERG_API_KEY! });
72
71
 
73
72
  const data = await readFile("invoice.pdf");
74
73
  const result = await client.extractAndWait({
@@ -83,7 +82,7 @@ console.log(result.result?.content);
83
82
  import { XbergClient } from "@xberg-io/sdk";
84
83
  import { readFile } from "node:fs/promises";
85
84
 
86
- const client = new XbergClient({ apiKey: process.env.XBERG_API_KEY! });
85
+ const client = new XbergClient({ baseUrl: "https://xberg.example.com", apiKey: process.env.XBERG_API_KEY! });
87
86
 
88
87
  const files = await Promise.all(
89
88
  ["a.pdf", "b.pdf", "c.pdf"].map(async (name) => ({
@@ -104,7 +103,7 @@ Shared surface (both tiers):
104
103
  |---|---|
105
104
  | `extract({ file, options? })` | `Promise<Job>` |
106
105
  | `extractBatch({ files, options? })` | `Promise<Job[]>` |
107
- | `getJob(jobId)` | `Promise<Job>` |
106
+ | `getJob(jobId)` | `Promise<GetJobResponse>` (tagged extraction or crawl) |
108
107
  | `getJobResult(jobId)` | `Promise<JobResult>` |
109
108
  | `waitForJob(jobId, opts?)` | `Promise<Job>` |
110
109
  | `waitForJobs(jobIds, opts?)` | `Promise<Job[]>` |