Getting Started

Configuration

Demo and Production environment configuration

Configuration

Environments

The SDK supports two environments:

EnvironmentAuth URLAPI URL
demodemoauth.fatturazioneelettronica.aruba.itdemows.fatturazioneelettronica.aruba.it
productionauth.fatturazioneelettronica.aruba.itws.fatturazioneelettronica.aruba.it

Basic Configuration

import { ArubaClient } from '@fatturazione-elettronica-aruba/core';

// Demo environment (testing)
const demoClient = new ArubaClient({
  environment: 'demo',
});

// Production environment
const prodClient = new ArubaClient({
  environment: 'production',
});

Advanced Options

const client = new ArubaClient({
  environment: 'production',
  timeout: 60000,      // HTTP timeout (default: 30000ms)
  maxRetries: 5,       // Max retries for 429 errors (default: 3)
  tokenStorage: {
    getToken: async () => localStorage.getItem('aruba_token'),
    setToken: async (token) => localStorage.setItem('aruba_token', JSON.stringify(token)),
    clearToken: async () => localStorage.removeItem('aruba_token'),
  },
});

Rate Limits

OperationLimit
Authentication1 req/min per IP
Invoice upload30 req/min per IP
Invoice search12 req/min per IP

The SDK automatically handles 429 errors with retry and exponential backoff.

File Limits

Maximum upload size: 5 MB