# SDK Overview (https://eulabel.eu/docs/documentation/sdks)

> Fetch the complete documentation index at: https://eulabel.eu/docs/llms.txt
> Use this file to discover all available pages before exploring further.
> Full content: https://eulabel.eu/docs/llms-full.txt
> Append .md to any page URL for markdown, or send Accept: text/markdown.



The EUlabel SDK provides typed, ergonomic client libraries that handle authentication, request formatting, retries, and error handling so you interact with a clean interface rather than raw HTTP.

Available SDKs [#available-sdks]

- [TypeScript / JavaScript](https://eulabel.eu/docs/documentation/sdks/typescript) — @eulabel/sdk — npm install @eulabel/sdk
- [Python](https://eulabel.eu/docs/documentation/sdks/python) — eulabel — pip install eulabel
What the SDK handles [#what-the-sdk-handles]

| Concern        | Without SDK                                | With SDK                                              |
| -------------- | ------------------------------------------ | ----------------------------------------------------- |
| Authentication | Manual token management, header formatting | Automatic, set once                                   |
| API requests   | Raw HTTP calls, URL construction           | Typed methods with parameter validation               |
| Error handling | Parse error responses, implement retries   | Built-in retry with exponential backoff, typed errors |
| Versioning     | Track API version changes manually         | SDK version pinned to API version                     |

Quick example (TypeScript) [#quick-example-typescript]
```typescript
import { EUlabel } from '@eulabel/sdk';

const client = new EUlabel({ apiKey: 'sk_test_...' });

const product = await client.products.create({
  name: 'Quinta da Bacalhoa Reserva 2022',
  category: 'wine',
  brand: 'Bacalhoa',
  gtin: '5601234567890',
});

const passport = await client.passports.create({
  productId: product.productId,
  data: {
    productType: 'wine',
    ingredients: ['Grapes', 'Sulphites'],
    nutrition: { energyKj: 351, energyKcal: 84, fatG: 0, saturatedFatG: 0, carbohydratesG: 1, sugarsG: 0.1, proteinG: 0, saltG: 0, alcoholG: 11.1 },
    allergens: { containsSulphites: true, containsEgg: false, containsFish: false, containsMilk: false },
    origin: { country: 'PT', region: 'Setubal' },
    producers: [{ name: 'Bacalhoa', role: 'producer', country: 'PT' }],
  },
});
```
Helper functions [#helper-functions]

| Helper                                         | Purpose                                  |
| ---------------------------------------------- | ---------------------------------------- |
| `client.products.getPassport(id)`              | Retrieve a product's passport            |
| `client.analytics.getProduct(id, opts)`        | Get scan analytics with date filters     |
| `client.webhooks.verify(payload, sig, secret)` | Verify an inbound webhook signature      |
| `client.passports.validate(data)`              | Validate passport data before submission |

