Package Exports
- furs-client-ts
- furs-client-ts/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (furs-client-ts) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
furs-client-ts
Professional TypeScript client for FURS (Financial Administration of the Republic of Slovenia) invoice fiscalization and business premise registration with full type safety and IntelliSense support.
β¨ Features
- π’ Business Premise Registration - Register and manage business premises with FURS
- π§Ύ Invoice Fiscalization - Fiscalize invoices and generate EOR (Unique Invoice ID)
- π Certificate Authentication - Secure P12 certificate-based authentication
- π― Full TypeScript Support - Complete type definitions with IntelliSense
- π‘οΈ Type Safety - Compile-time error prevention and runtime validation
- π Environment Support - Both test and production FURS environments
- β‘ Easy Integration - Simple, intuitive API for rapid development
- π Self-Documenting - Rich type definitions serve as inline documentation
- π§ͺ Thoroughly Tested - Comprehensive unit and integration test coverage
π Quick Start
Installation
npm install furs-client-ts
Basic Usage
import { FursClient, InvoiceRequest, BusinessPremiseRequest } from 'furs-client-ts';
// Initialize with full type safety
const client = new FursClient({
certPath: './your-certificate.p12',
certPassword: 'your-password',
taxNumber: 12345678,
environment: 'test' // TypeScript ensures only 'test' | 'production'
});
// Register business premise with typed interfaces
const premise: BusinessPremiseRequest = {
identifier: {
RealEstateBP: {
PropertyID: { CadastralNumber: 365, BuildingNumber: 12 },
Address: {
Street: 'TrΕΎaΕ‘ka cesta',
HouseNumber: '24',
Community: 'Ljubljana',
City: 'Ljubljana',
PostalCode: '1000'
}
}
},
validityDate: '2026-01-01T22:30:47'
};
const premiseResult = await client.registerBusinessPremise(premise);
// Fiscalize invoice with compile-time validation
const invoice: InvoiceRequest = {
businessPremiseId: premiseResult.businessPremiseId,
electronicDeviceId: 'ED001',
invoiceAmount: 122.0,
taxesPerSeller: [{
VAT: [{
TaxRate: 22.0,
TaxableAmount: 100.0,
TaxAmount: 22.0
}]
}]
};
const result = await client.fiscalizeInvoice(invoice);
console.log('EOR:', result.uniqueInvoiceId);
console.log('ZOI:', result.zoi);
π Why Choose This Library?
π― Type Safety First
- Compile-time validation catches errors before they reach production
- IntelliSense support provides auto-completion and inline documentation
- Strongly typed interfaces for all FURS data structures
- Type guards prevent runtime type errors
π Production Ready
- Thoroughly tested with both unit and integration tests
- Real FURS integration - tested against actual FURS test environment
- Comprehensive error handling with typed custom exceptions
- Certificate validation and secure authentication
π οΈ Developer Experience
- Rich IDE support with full IntelliSense in VS Code, WebStorm, etc.
- Self-documenting code through TypeScript interfaces
- Extensive examples and documentation
- Easy debugging with source maps and clear error messages
π What's Included
Core Functionality
- β Business premise registration and management
- β Invoice fiscalization with ZOI generation
- β P12 certificate handling and JWT signing
- β Both test and production environment support
- β Comprehensive error handling with custom error types
TypeScript Features
- β Complete type definitions for all operations
- β Strongly typed configuration and responses
- β Type-safe error handling with custom exception classes
- β IntelliSense support in all major IDEs
- β Compile-time validation of all parameters
Developer Tools
- β Comprehensive test suite (unit + integration)
- β TypeScript examples and usage guides
- β Debug logging and error diagnostics
- β Source maps for easy debugging
π§ Requirements
- Node.js >= 14.0.0
- TypeScript >= 4.0.0 (for development)
- Valid FURS P12 certificate
- Internet connection for FURS API access
π Documentation
- Getting Started Guide - Complete setup and usage guide
- API Reference - Full TypeScript API documentation
- Error Handling Guide - Comprehensive error handling
- Testing Guide - Unit and integration testing
- Production Deployment - Production best practices
π§ͺ Testing
# Run complete TypeScript test suite
npm test
# Run individual test phases
npm run test:unit # Unit tests only
npm run test:integration # Integration tests only
π€ Contributing
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Make your changes with proper TypeScript types
- Add tests for your changes
- Ensure all tests pass:
npm test
- Commit your changes:
git commit -m 'Add amazing feature'
- Push to the branch:
git push origin feature/amazing-feature
- Open a Pull Request
π License
This project is licensed under the MIT License - see the LICENSE file for details.
β Support
- π Documentation
- π Issue Tracker
- π¬ Discussions
- π§ Email: Contact via GitHub
- β Buy Me a Coffee - Support development
π― Used By
This library is trusted by:
- E-commerce platforms integrating with Slovenian tax system
- Accounting software companies
- POS system developers
- Invoice management applications
π¨βπ» Author
Created and maintained by nejcar20
- GitHub: @nejcar20
- Repository: furs-client-ts
- β Support my work
Made with β€οΈ for the Slovenian developer community
Simplifying FURS integration with modern TypeScript development practices.
β Buy me a coffee if this library helps you!