Skip to main content
Version: 1.002.000

SDK Smart Services

The official Smart Services SDKs simplify integration with our AI and automation services by providing native libraries for the most popular programming languages.

SDK available​

🟨 JavaScript/TypeScript​

  • NPM Package: @teamsystem/smart-services-sdk
  • Supporto: Node.js 16+, Browser (con bundler)
  • Features: Promise-based, TypeScript definitions, auto-retry

🟦 .NET (C#)​

  • NuGet Package: TeamSystem.SmartServices.SDK
  • Supporto: .NET 6+, .NET Framework 4.8+
  • Features: Async/await, strong typing, dependency injection

🟩 Python​

  • PyPI Package: teamsystem-smart-services
  • Supporto: Python 3.8+
  • Features: Async/await, type hints, pytest integration

🟧 Java (In sviluppo)​

  • Maven Package: com.teamsystem:smart-services-sdk
  • Supporto: Java 11+, Android
  • Status: Coming soon in v1.1.0

Common Features​

πŸ” Automatic Authentication​

  • Automatic management of OAuth 2.0 tokens
  • Automatic refresh of expired tokens
  • Support for API Key and Client Credentials

Retry and Resilience​

  • Automatic retry for temporary errors
  • Configurable exponential backoff
  • Circuit breaker for repeated failures

Monitoring and Logging​

  • Structured logging of requests
  • Integrated performance metrics
  • Distributed tracing

Type Safety​

  • Strongly-typed data models
  • Automatic parameter validation
  • Full IntelliSense support in IDEs

Quick Installation​

JavaScript/Node.js​

npm install @teamsystem/smart-services-sdk
import { SmartServicesClient } from '@teamsystem/smart-services-sdk';

const client = new SmartServicesClient({
apiKey: process.env.SMART_SERVICES_API_KEY,
environment: 'production'
});

.NET/C#​

dotnet add package TeamSystem.SmartServices.SDK
using TeamSystem.SmartServices;

var client = new SmartServicesClient(new SmartServicesOptions
{
ApiKey = Environment.GetEnvironmentVariable("SMART_SERVICES_API_KEY"),
Environment = SmartServicesEnvironment.Production
});

Python​

pip install teamsystem-smart-services
from teamsystem_smart_services import SmartServicesClient

client = SmartServicesClient(
api_key=os.environ['SMART_SERVICES_API_KEY'],
environment='production'
)

Usage Examples​

Document Analysis (Multi-language)​

// Invoice Analysis with JavaScript
const result = await client.ai.analyzeDocument({
file: './invoice.pdf',
type: 'invoice',
language: 'it'
});

console.log(`Fornitore: ${result.supplier.name}`);
console.log(`Totale: €${result.amounts.total}`);

Workflow automation​

// Workflow creation
const workflow = await client.automation.createWorkflow({
name: 'Processo Approvazione Fatture',
trigger: {
type: 'document_uploaded',
filters: { document_type: 'invoice' }
},
steps: [
{
type: 'ai_analysis',
service: 'document_analysis'
},
{
type: 'approval_request',
assignee: 'finance_team'
},
{
type: 'integration',
target: 'erp_system'
}
]
});

Advanced Configuration​

Environment Management​

// Configuration for Different Environments
const client = new SmartServicesClient({
apiKey: process.env.SMART_SERVICES_API_KEY,
environment: process.env.NODE_ENV === 'production' ? 'production' : 'sandbox',
timeout: 30000,
retryAttempts: 3,
retryDelay: 1000
});

Custom Logging​

// Logging Configuration
const client = new SmartServicesClient({
apiKey: 'your-api-key',
logger: {
level: 'debug',
format: 'json',
destination: './logs/smart-services.log'
}
});

Interceptors for Requests​

// Adding Custom Headers
client.interceptors.request.use((config) => {
config.headers['X-Request-ID'] = generateRequestId();
config.headers['X-User-Agent'] = 'MyApp/1.0.0';
return config;
});

// Response Logging
client.interceptors.response.use((response) => {
console.log(`Request completed: ${response.status} ${response.statusText}`);
return response;
});

Testing​

Unit testing con mock​

// Jest test con mock
import { SmartServicesClient } from '@teamsystem/smart-services-sdk';
import { mockDocumentAnalysis } from '@teamsystem/smart-services-sdk/testing';

describe('Document Analysis', () => {
let client;

beforeEach(() => {
client = new SmartServicesClient({ apiKey: 'test-key' });
mockDocumentAnalysis();
});

test('should analyze invoice correctly', async () => {
const result = await client.ai.analyzeDocument({
file: './test-invoice.pdf',
type: 'invoice'
});

expect(result.supplier.name).toBe('Test Supplier');
expect(result.amounts.total).toBe(1000);
});
});

Integration testing​

// Integration Test 
const client = new SmartServicesClient({
apiKey: process.env.TEST_API_KEY,
environment: 'sandbox'
});

test('integration: full document analysis flow', async () => {
const result = await client.ai.analyzeDocument({
file: './fixtures/sample-invoice.pdf',
type: 'invoice',
language: 'it'
});

expect(result.status).toBe('completed');
expect(result.confidence).toBeGreaterThan(0.8);
});

Migration and Updates​

Versioning policy​

  • Patch releases (1.0.x): Bug fixes, nessun breaking change
  • Minor releases (1.x.0): Nuove features, backward compatible
  • Major releases (x.0.0): Breaking changes, migration guide fornita

Changelog​

Keep your SDK always up to date:

# Check the current version
npm list @teamsystem/smart-services-sdk

# Update to the latest
npm update @teamsystem/smart-services-sdk

Support and community​

πŸ“š Resources​

πŸ’¬ Community​

πŸ› Report bugs​

The SDKs are open source, and community contributions are welcome!