@beel_es/sdk 1.0.0 → 1.2.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/LICENSE +21 -0
- package/README.md +234 -74
- package/dist/index.d.mts +26774 -0
- package/dist/index.d.ts +26769 -21
- package/dist/index.js +1556 -50
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1497 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +49 -19
- package/dist/client.d.ts +0 -54
- package/dist/client.d.ts.map +0 -1
- package/dist/client.js +0 -94
- package/dist/client.js.map +0 -1
- package/dist/generated/client/client.gen.d.ts +0 -3
- package/dist/generated/client/client.gen.d.ts.map +0 -1
- package/dist/generated/client/client.gen.js +0 -240
- package/dist/generated/client/client.gen.js.map +0 -1
- package/dist/generated/client/index.d.ts +0 -9
- package/dist/generated/client/index.d.ts.map +0 -1
- package/dist/generated/client/index.js +0 -18
- package/dist/generated/client/index.js.map +0 -1
- package/dist/generated/client/types.gen.d.ts +0 -118
- package/dist/generated/client/types.gen.d.ts.map +0 -1
- package/dist/generated/client/types.gen.js +0 -4
- package/dist/generated/client/types.gen.js.map +0 -1
- package/dist/generated/client/utils.gen.d.ts +0 -34
- package/dist/generated/client/utils.gen.d.ts.map +0 -1
- package/dist/generated/client/utils.gen.js +0 -242
- package/dist/generated/client/utils.gen.js.map +0 -1
- package/dist/generated/client.gen.d.ts +0 -13
- package/dist/generated/client.gen.d.ts.map +0 -1
- package/dist/generated/client.gen.js +0 -7
- package/dist/generated/client.gen.js.map +0 -1
- package/dist/generated/core/auth.gen.d.ts +0 -19
- package/dist/generated/core/auth.gen.d.ts.map +0 -1
- package/dist/generated/core/auth.gen.js +0 -19
- package/dist/generated/core/auth.gen.js.map +0 -1
- package/dist/generated/core/bodySerializer.gen.d.ts +0 -26
- package/dist/generated/core/bodySerializer.gen.d.ts.map +0 -1
- package/dist/generated/core/bodySerializer.gen.js +0 -61
- package/dist/generated/core/bodySerializer.gen.js.map +0 -1
- package/dist/generated/core/params.gen.d.ts +0 -44
- package/dist/generated/core/params.gen.d.ts.map +0 -1
- package/dist/generated/core/params.gen.js +0 -105
- package/dist/generated/core/params.gen.js.map +0 -1
- package/dist/generated/core/pathSerializer.gen.d.ts +0 -34
- package/dist/generated/core/pathSerializer.gen.d.ts.map +0 -1
- package/dist/generated/core/pathSerializer.gen.js +0 -116
- package/dist/generated/core/pathSerializer.gen.js.map +0 -1
- package/dist/generated/core/queryKeySerializer.gen.d.ts +0 -19
- package/dist/generated/core/queryKeySerializer.gen.d.ts.map +0 -1
- package/dist/generated/core/queryKeySerializer.gen.js +0 -99
- package/dist/generated/core/queryKeySerializer.gen.js.map +0 -1
- package/dist/generated/core/serverSentEvents.gen.d.ts +0 -72
- package/dist/generated/core/serverSentEvents.gen.d.ts.map +0 -1
- package/dist/generated/core/serverSentEvents.gen.js +0 -138
- package/dist/generated/core/serverSentEvents.gen.js.map +0 -1
- package/dist/generated/core/types.gen.d.ts +0 -79
- package/dist/generated/core/types.gen.d.ts.map +0 -1
- package/dist/generated/core/types.gen.js +0 -4
- package/dist/generated/core/types.gen.js.map +0 -1
- package/dist/generated/core/utils.gen.d.ts +0 -20
- package/dist/generated/core/utils.gen.d.ts.map +0 -1
- package/dist/generated/core/utils.gen.js +0 -94
- package/dist/generated/core/utils.gen.js.map +0 -1
- package/dist/generated/index.d.ts +0 -3
- package/dist/generated/index.d.ts.map +0 -1
- package/dist/generated/index.js +0 -84
- package/dist/generated/index.js.map +0 -1
- package/dist/generated/sdk.gen.d.ts +0 -966
- package/dist/generated/sdk.gen.d.ts.map +0 -1
- package/dist/generated/sdk.gen.js +0 -1490
- package/dist/generated/sdk.gen.js.map +0 -1
- package/dist/generated/types.gen.d.ts +0 -5646
- package/dist/generated/types.gen.d.ts.map +0 -1
- package/dist/generated/types.gen.js +0 -4
- package/dist/generated/types.gen.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/resources/companies.d.ts +0 -75
- package/dist/resources/companies.d.ts.map +0 -1
- package/dist/resources/companies.js +0 -77
- package/dist/resources/companies.js.map +0 -1
- package/dist/resources/config.d.ts +0 -106
- package/dist/resources/config.d.ts.map +0 -1
- package/dist/resources/config.js +0 -86
- package/dist/resources/config.js.map +0 -1
- package/dist/resources/customers.d.ts +0 -172
- package/dist/resources/customers.d.ts.map +0 -1
- package/dist/resources/customers.js +0 -96
- package/dist/resources/customers.js.map +0 -1
- package/dist/resources/invoices.d.ts +0 -370
- package/dist/resources/invoices.d.ts.map +0 -1
- package/dist/resources/invoices.js +0 -174
- package/dist/resources/invoices.js.map +0 -1
- package/dist/resources/products.d.ts +0 -155
- package/dist/resources/products.d.ts.map +0 -1
- package/dist/resources/products.js +0 -96
- package/dist/resources/products.js.map +0 -1
- package/dist/resources/series.d.ts +0 -98
- package/dist/resources/series.d.ts.map +0 -1
- package/dist/resources/series.js +0 -83
- package/dist/resources/series.js.map +0 -1
- package/dist/webhooks/index.d.ts +0 -20
- package/dist/webhooks/index.d.ts.map +0 -1
- package/dist/webhooks/index.js +0 -70
- package/dist/webhooks/index.js.map +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 BeeL - Facturación para Autónomos
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,131 +1,291 @@
|
|
|
1
|
-
# BeeL
|
|
1
|
+
# BeeL Node.js SDK
|
|
2
2
|
|
|
3
|
-
[](https://www.typescriptlang.org/)
|
|
3
|
+
[](https://www.npmjs.com/package/@beel_es/sdk)
|
|
5
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
[](https://www.typescriptlang.org/)
|
|
6
6
|
|
|
7
|
-
Official TypeScript
|
|
7
|
+
Official Node.js/TypeScript SDK for the [BeeL API](https://beel.es) — Spanish invoicing for self-employed professionals with VeriFactu compliance.
|
|
8
|
+
|
|
9
|
+
**Node.js 18+. Single dependency ([openapi-fetch](https://openapi-ts.dev/openapi-fetch/)).**
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
- **Full TypeScript types** auto-generated from OpenAPI spec
|
|
14
|
+
- **Automatic retries** with exponential backoff on 429 and 5xx
|
|
15
|
+
- **Auto idempotency keys** on every POST request
|
|
16
|
+
- **Typed errors** — catch `BeeLNotFoundError` instead of checking status codes
|
|
17
|
+
- **PDF download** as Buffer
|
|
18
|
+
- **Webhook signature verification** with HMAC-SHA256
|
|
19
|
+
- **Instance-based client** — multiple API keys, no global state
|
|
20
|
+
- **ESM + CommonJS**
|
|
8
21
|
|
|
9
22
|
## Installation
|
|
10
23
|
|
|
11
24
|
```bash
|
|
12
|
-
npm install @
|
|
25
|
+
npm install @beel_es/sdk
|
|
13
26
|
```
|
|
14
27
|
|
|
15
28
|
## Quick Start
|
|
16
29
|
|
|
17
30
|
```typescript
|
|
18
|
-
import { BeeL } from '@
|
|
31
|
+
import { BeeL } from '@beel_es/sdk';
|
|
19
32
|
|
|
20
|
-
|
|
21
|
-
const beel = await BeeL.create('beel_sk_live_...');
|
|
33
|
+
const beel = new BeeL({ apiKey: 'beel_sk_live_...' });
|
|
22
34
|
|
|
23
|
-
//
|
|
24
|
-
const
|
|
35
|
+
// Address a company (NIF) explicitly — the recommended multi-NIF surface
|
|
36
|
+
const company = beel.company('company-uuid');
|
|
25
37
|
|
|
26
|
-
//
|
|
27
|
-
const invoice = await
|
|
38
|
+
// Create a draft invoice
|
|
39
|
+
const invoice = await company.invoices.create({
|
|
40
|
+
type: 'STANDARD',
|
|
41
|
+
recipient: { customer_id: 'customer-uuid' },
|
|
42
|
+
lines: [
|
|
43
|
+
{ line_type: 'NORMAL', description: 'Consulting', quantity: 1, unit_price: 100, discount_percentage: 0 },
|
|
44
|
+
],
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
console.log(invoice.id); // UUID assigned immediately
|
|
48
|
+
|
|
49
|
+
// Issue it to assign an invoice number and trigger VeriFactu
|
|
50
|
+
const issued = await company.invoices.issue(invoice.id);
|
|
51
|
+
console.log(issued.invoice_number); // e.g. "A-2026/0001"
|
|
28
52
|
```
|
|
29
53
|
|
|
30
|
-
##
|
|
54
|
+
## Companies (multi-NIF)
|
|
31
55
|
|
|
32
|
-
|
|
56
|
+
Every operation on `beel.company(companyId)` addresses the company in the URL path, so it
|
|
57
|
+
works with any number of NIFs and never depends on a session focus:
|
|
33
58
|
|
|
34
59
|
```typescript
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
});
|
|
60
|
+
const company = beel.company('company-uuid');
|
|
61
|
+
|
|
62
|
+
// Invoices — full lifecycle
|
|
63
|
+
const { invoices, pagination } = await company.invoices.list({ status: 'ISSUED' });
|
|
64
|
+
await company.invoices.issue('invoice-uuid');
|
|
65
|
+
await company.invoices.void('invoice-uuid', { reason: 'Billing error' });
|
|
66
|
+
await company.invoices.createCorrective('invoice-uuid', { ... });
|
|
67
|
+
const pdf = await company.invoices.getPdf('invoice-uuid');
|
|
68
|
+
|
|
69
|
+
// Customers, products, series
|
|
70
|
+
const customer = await company.customers.create({ ... });
|
|
71
|
+
const product = await company.products.create({ ... });
|
|
72
|
+
await company.series.ensureDefaults(); // idempotent seeding of the typed default series
|
|
73
|
+
|
|
74
|
+
// Recurring invoices
|
|
75
|
+
await company.recurringInvoices.create({ ... });
|
|
76
|
+
await company.recurringInvoices.setStatus('rec-uuid', { status: 'PAUSED' });
|
|
77
|
+
|
|
78
|
+
// Company health
|
|
79
|
+
const summary = await company.fiscalSummary({ year: 2026 });
|
|
80
|
+
const readiness = await company.issuingReadiness();
|
|
81
|
+
```
|
|
39
82
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
});
|
|
83
|
+
## Accounts (managed accounts, members & webhooks)
|
|
84
|
+
|
|
85
|
+
For integrators managing several accounts (provisioning, gestorías, platforms):
|
|
86
|
+
|
|
87
|
+
```typescript
|
|
88
|
+
// List and provision managed accounts
|
|
89
|
+
const { accounts } = await beel.accounts.list();
|
|
90
|
+
const created = await beel.accounts.provision({ external_ref: 'client-42' });
|
|
91
|
+
|
|
92
|
+
// Scope to one account
|
|
93
|
+
const account = beel.account(created.account_id);
|
|
48
94
|
|
|
49
|
-
//
|
|
50
|
-
await
|
|
51
|
-
await
|
|
52
|
-
await beel.invoices.markPaid('invoice-id', { body: { payment_date: '2026-03-10' } });
|
|
95
|
+
// Companies (NIFs) under the account
|
|
96
|
+
const { companies } = await account.companies.list();
|
|
97
|
+
await account.companies.create({ nif: 'B12345678', ... });
|
|
53
98
|
|
|
54
|
-
//
|
|
55
|
-
const
|
|
99
|
+
// Members, roles and per-company grants
|
|
100
|
+
const members = await account.members.list();
|
|
101
|
+
await account.members.putGrant('member-id', 'company-id', { permissions: [...] });
|
|
102
|
+
|
|
103
|
+
// Invitations
|
|
104
|
+
await account.invitations.create({ invited_email: 'user@example.com', account_role: 'MEMBER' });
|
|
105
|
+
|
|
106
|
+
// Account-scoped webhooks
|
|
107
|
+
const webhook = await account.webhooks.create({ url: 'https://...', events: ['invoice.issued'] });
|
|
108
|
+
await account.webhooks.test(webhook.id);
|
|
109
|
+
await account.webhooks.rotateSecret(webhook.id);
|
|
110
|
+
|
|
111
|
+
// Usage & ownership
|
|
112
|
+
const usage = await account.usage();
|
|
113
|
+
await account.createClaimToken(); // let the end user claim the account
|
|
56
114
|
```
|
|
57
115
|
|
|
58
|
-
|
|
116
|
+
## Resources (deprecated session-focus surface)
|
|
117
|
+
|
|
118
|
+
> **Deprecated:** the API contract marks the whole session-focus surface (`beel.invoices`,
|
|
119
|
+
> `beel.customers`, `beel.products`, `beel.series`, `beel.configuration`) as deprecated.
|
|
120
|
+
> Prefer the company-scoped equivalents above. These keep working during the sunset window.
|
|
59
121
|
|
|
60
122
|
```typescript
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
await beel.
|
|
64
|
-
await beel.
|
|
123
|
+
// Invoices
|
|
124
|
+
const { invoices, pagination } = await beel.invoices.list({ status: 'ISSUED', limit: 20 });
|
|
125
|
+
const invoice = await beel.invoices.get('invoice-uuid');
|
|
126
|
+
const created = await beel.invoices.create({ ... });
|
|
127
|
+
const updated = await beel.invoices.update('id', { ... });
|
|
128
|
+
await beel.invoices.delete('id');
|
|
129
|
+
|
|
130
|
+
// Invoice lifecycle
|
|
131
|
+
await beel.invoices.issue('id');
|
|
132
|
+
await beel.invoices.markPaid('id');
|
|
133
|
+
await beel.invoices.markSent('id');
|
|
134
|
+
await beel.invoices.void('id', { reason: 'Duplicate invoice sent in error' });
|
|
135
|
+
await beel.invoices.schedule('id', { scheduled_for: '2026-04-15' });
|
|
136
|
+
await beel.invoices.unschedule('id');
|
|
137
|
+
await beel.invoices.duplicate('id');
|
|
138
|
+
await beel.invoices.createCorrective('id', { ... });
|
|
139
|
+
|
|
140
|
+
// Customers
|
|
141
|
+
const { customers, pagination } = await beel.customers.list({ search: 'Acme' });
|
|
142
|
+
const customer = await beel.customers.create({
|
|
143
|
+
legal_name: 'Acme SL',
|
|
144
|
+
nif: 'B86561412',
|
|
145
|
+
address: { street: 'Calle Mayor', number: '1', postal_code: '28001', city: 'Madrid', province: 'Madrid', country: 'Spain', country_code: 'ES' },
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
// Products
|
|
149
|
+
const { products } = await beel.products.list();
|
|
150
|
+
const results = await beel.products.search('consulting');
|
|
151
|
+
|
|
152
|
+
// Configuration
|
|
153
|
+
const taxConfig = await beel.configuration.getTaxConfig();
|
|
154
|
+
const series = await beel.series.list();
|
|
155
|
+
|
|
156
|
+
// NIF validation
|
|
157
|
+
const result = await beel.nif.validate('B12345678');
|
|
65
158
|
```
|
|
66
159
|
|
|
67
|
-
|
|
160
|
+
## Typed Errors
|
|
161
|
+
|
|
162
|
+
Every API error maps to a specific error class:
|
|
68
163
|
|
|
69
164
|
```typescript
|
|
70
|
-
|
|
71
|
-
|
|
165
|
+
import { BeeL, BeeLNotFoundError, BeeLValidationError } from '@beel_es/sdk';
|
|
166
|
+
|
|
167
|
+
try {
|
|
168
|
+
await beel.invoices.get('nonexistent-id');
|
|
169
|
+
} catch (error) {
|
|
170
|
+
if (error instanceof BeeLNotFoundError) {
|
|
171
|
+
console.log(error.message); // "Invoice not found"
|
|
172
|
+
console.log(error.requestId); // "abc123" (for support)
|
|
173
|
+
}
|
|
174
|
+
if (error instanceof BeeLValidationError) {
|
|
175
|
+
console.log(error.message); // "El NIF no tiene un formato válido"
|
|
176
|
+
console.log(error.details); // { field: "nif", invalid_value: "..." }
|
|
177
|
+
}
|
|
178
|
+
}
|
|
72
179
|
```
|
|
73
180
|
|
|
74
|
-
|
|
181
|
+
| Error class | Status | When |
|
|
182
|
+
|---|---|---|
|
|
183
|
+
| `BeeLAuthError` | 401, 403 | Invalid or missing API key |
|
|
184
|
+
| `BeeLNotFoundError` | 404 | Resource doesn't exist |
|
|
185
|
+
| `BeeLValidationError` | 422 | Invalid data |
|
|
186
|
+
| `BeeLConflictError` | 409 | Duplicate (e.g. same NIF) |
|
|
187
|
+
| `BeeLRateLimitError` | 429 | Too many requests (auto-retried) |
|
|
188
|
+
| `BeeLApiError` | 5xx | Server error (auto-retried) |
|
|
189
|
+
|
|
190
|
+
## Automatic Retries
|
|
191
|
+
|
|
192
|
+
429 and 5xx errors are retried with exponential backoff. Client errors (400, 401, 404, 422) are never retried.
|
|
75
193
|
|
|
76
194
|
```typescript
|
|
77
|
-
const
|
|
78
|
-
|
|
195
|
+
const beel = new BeeL({
|
|
196
|
+
apiKey: 'beel_sk_live_...',
|
|
197
|
+
maxRetries: 5, // default: 3
|
|
198
|
+
retryDelayMs: 1000, // default: 500
|
|
199
|
+
maxRetryDelayMs: 60000, // default: 30000
|
|
200
|
+
});
|
|
79
201
|
```
|
|
80
202
|
|
|
81
|
-
|
|
203
|
+
## PDF Download
|
|
82
204
|
|
|
83
205
|
```typescript
|
|
84
|
-
|
|
85
|
-
|
|
206
|
+
import fs from 'fs';
|
|
207
|
+
|
|
208
|
+
const { buffer, fileName } = await beel.downloadPdf('invoice-uuid');
|
|
209
|
+
fs.writeFileSync(fileName, buffer);
|
|
210
|
+
// => factura_A-2026-0001.pdf
|
|
86
211
|
```
|
|
87
212
|
|
|
88
|
-
##
|
|
213
|
+
## Webhooks
|
|
214
|
+
|
|
215
|
+
Verify webhook signatures before processing:
|
|
89
216
|
|
|
90
217
|
```typescript
|
|
91
|
-
import
|
|
218
|
+
import express from 'express';
|
|
219
|
+
import { WebhookVerifier } from '@beel_es/sdk';
|
|
92
220
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
221
|
+
const verifier = new WebhookVerifier(process.env.BEEL_WEBHOOK_SECRET!);
|
|
222
|
+
|
|
223
|
+
app.post('/webhooks/beel', express.raw({ type: 'application/json' }), (req, res) => {
|
|
224
|
+
try {
|
|
225
|
+
const event = verifier.verify(
|
|
226
|
+
req.body.toString('utf8'),
|
|
227
|
+
req.headers['beel-signature'] as string,
|
|
228
|
+
);
|
|
229
|
+
|
|
230
|
+
if (event.type === 'verifactu.status.updated') {
|
|
231
|
+
console.log(event.data.new_status); // 'ACCEPTED' | 'REJECTED'
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
res.status(200).send('OK');
|
|
235
|
+
} catch {
|
|
236
|
+
res.status(400).send('Invalid signature');
|
|
99
237
|
}
|
|
100
|
-
}
|
|
238
|
+
});
|
|
101
239
|
```
|
|
102
240
|
|
|
103
|
-
##
|
|
241
|
+
## Builders
|
|
242
|
+
|
|
243
|
+
Optional fluent builders for common operations:
|
|
104
244
|
|
|
105
245
|
```typescript
|
|
106
|
-
|
|
107
|
-
|
|
246
|
+
import { InvoiceBuilder, CustomerBuilder } from '@beel_es/sdk';
|
|
247
|
+
|
|
248
|
+
const customer = CustomerBuilder.create()
|
|
249
|
+
.name('Acme SL')
|
|
250
|
+
.nif('B12345678')
|
|
251
|
+
.email('contact@acme.com')
|
|
252
|
+
.address('Calle Mayor', '1', '28001', 'Madrid', 'Madrid', 'Spain')
|
|
253
|
+
.build();
|
|
254
|
+
|
|
255
|
+
const invoice = InvoiceBuilder.create()
|
|
256
|
+
.forCustomer('customer-uuid')
|
|
257
|
+
.addLine('Service A', 5, 100.0)
|
|
258
|
+
.addLine('Service B', 3, 150.0)
|
|
259
|
+
.metadata({ stripe_id: 'pi_abc123' })
|
|
260
|
+
.build();
|
|
261
|
+
```
|
|
108
262
|
|
|
109
|
-
|
|
110
|
-
const beel = await BeeL.create({
|
|
111
|
-
apiKey: 'beel_sk_live_...',
|
|
112
|
-
baseUrl: 'https://test.beel.es/api',
|
|
113
|
-
});
|
|
263
|
+
## Environments
|
|
114
264
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
265
|
+
```typescript
|
|
266
|
+
// Sandbox — no VeriFactu quota consumed, safe to test
|
|
267
|
+
const sandbox = new BeeL({ apiKey: 'beel_sk_test_...' });
|
|
268
|
+
|
|
269
|
+
// Production
|
|
270
|
+
const prod = new BeeL({ apiKey: 'beel_sk_live_...' });
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
## Full Configuration
|
|
274
|
+
|
|
275
|
+
```typescript
|
|
276
|
+
const beel = new BeeL({
|
|
277
|
+
apiKey: 'beel_sk_live_...', // Required
|
|
278
|
+
baseUrl: 'https://app.beel.es/api', // Default
|
|
279
|
+
maxRetries: 3, // Default
|
|
280
|
+
retryDelayMs: 500, // Default
|
|
281
|
+
maxRetryDelayMs: 30000, // Default
|
|
119
282
|
});
|
|
120
283
|
```
|
|
121
284
|
|
|
122
|
-
##
|
|
285
|
+
## Documentation
|
|
123
286
|
|
|
124
|
-
|
|
125
|
-
- TypeScript 5.0+ (optional but recommended)
|
|
287
|
+
Full API docs: [docs.beel.es](https://docs.beel.es)
|
|
126
288
|
|
|
127
|
-
##
|
|
289
|
+
## License
|
|
128
290
|
|
|
129
|
-
|
|
130
|
-
- [Website](https://beel.es)
|
|
131
|
-
- [Support](mailto:info@beel.es)
|
|
291
|
+
MIT
|