EUlabel
SDK

SDK Overview

Client libraries for TypeScript and Python that simplify EUlabel API integration.

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

LanguagePackageInstall
TypeScript / JavaScript@eulabel/sdknpm install @eulabel/sdk
Pythoneulabelpip install eulabel

What the SDK handles

ConcernWithout SDKWith SDK
AuthenticationManual token management, header formattingAutomatic, set once
API requestsRaw HTTP calls, URL constructionTyped methods with parameter validation
Error handlingParse error responses, implement retriesBuilt-in retry with exponential backoff, typed errors
VersioningTrack API version changes manuallySDK version pinned to API version

Quick example (TypeScript)

import { EUlabel } from '@eulabel/sdk';

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

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

HelperPurpose
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

On this page