npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

smartbill-ts-sdk

v1.1.8

Published

SmartBill TypeScript SDK

Downloads

23

Readme

SmartBill TypeScript SDK

SmartBill API Documentation GitHub: https://github.com/florin-szilagyi/smartbill-ts-sdk

English

Overview

This SDK provides a convenient way to interact with the SmartBill API from Node.js/TypeScript projects. It supports operations for invoices, proforma invoices (estimates), payments, configuration, and stock management.

Features

  • Create, view, and manage invoices and proforma invoices
  • Send documents by email
  • Download PDFs
  • Manage payments and stock
  • Full TypeScript support and validation

Installation

pnpm add smartbill-ts-sdk

Usage

Initialization

import { SmartBillSDK } from 'smartbill-ts-sdk';

const sdk = new SmartBillSDK({
  email: process.env.SMARTBILL_EMAIL!,
  token: process.env.SMARTBILL_TOKEN!,
  verbose: true,
});

Create a Simple Invoice

const invoicePayload = {
  companyVatCode: 'RO12345678',
  client: {
    name: 'Test Client',
    vatCode: 'RO12345678',
    isTaxPayer: true,
    address: 'Str. Test nr. 1',
    city: 'Bucharest',
    country: 'Romania',
    email: '[email protected]',
    saveToDb: false,
  },
  seriesName: 'FCT',
  issueDate: '2025-04-19',
  products: [
    {
      name: 'Product 1',
      measuringUnitName: 'buc',
      currency: 'RON',
      quantity: 1,
      price: 100,
      taxName: 'Normala',
      taxPercentage: 19,
      saveToDb: false,
      isService: false,
    },
  ],
};
const response = await sdk.invoices.create(invoicePayload);

Download Invoice PDF

const pdfBuffer = await sdk.invoices.getPdf({
  cif: 'RO12345678',
  seriesname: 'FCT',
  number: '123',
});
// Save pdfBuffer to file if needed

Create a Proforma Invoice (Estimate)

const estimatePayload = {
  companyVatCode: 'RO12345678',
  client: { ... }, // same as above
  seriesName: 'PFA',
  issueDate: '2025-04-19',
  dueDate: '2025-05-19',
  products: [ ... ],
};
const response = await sdk.estimates.create(estimatePayload);

Send Document by Email

await sdk.invoices.sendEmail({
  companyVatCode: 'RO12345678',
  seriesName: 'FCT',
  number: '123',
  type: 'invoice',
  to: '[email protected]',
});

Romanian / Română

Prezentare generală

Acest SDK oferă o modalitate simplă de a interacționa cu API-ul SmartBill din proiecte Node.js/TypeScript. Permite operațiuni pentru facturi, proforme, plăți, configurare și gestiune stocuri.

Funcționalități

  • Creare, vizualizare și gestionare facturi și proforme
  • Trimitere documente pe email
  • Descărcare PDF-uri
  • Administrare plăți și stocuri
  • Validare și suport complet TypeScript

Instalare

pnpm add smartbill-ts-sdk

Utilizare

Inițializare

import { SmartBillSDK } from 'smartbill-ts-sdk';

const sdk = new SmartBillSDK({
  email: process.env.SMARTBILL_EMAIL!,
  token: process.env.SMARTBILL_TOKEN!,
  verbose: true,
});

Emitere Factură Simplă

const payloadFactura = {
  companyVatCode: 'RO12345678',
  client: {
    name: 'Client Test',
    vatCode: 'RO12345678',
    isTaxPayer: true,
    address: 'Str. Test nr. 1',
    city: 'București',
    country: 'România',
    email: '[email protected]',
    saveToDb: false,
  },
  seriesName: 'FCT',
  issueDate: '2025-04-19',
  products: [
    {
      name: 'Produs 1',
      measuringUnitName: 'buc',
      currency: 'RON',
      quantity: 1,
      price: 100,
      taxName: 'Normala',
      taxPercentage: 19,
      saveToDb: false,
      isService: false,
    },
  ],
};
const response = await sdk.invoices.create(payloadFactura);

Descărcare PDF Factură

const pdfBuffer = await sdk.invoices.getPdf({
  cif: 'RO12345678',
  seriesname: 'FCT',
  number: '123',
});
// Salvează pdfBuffer într-un fișier dacă este nevoie

Emitere Proformă

const payloadProforma = {
  companyVatCode: 'RO12345678',
  client: { ... }, // la fel ca mai sus
  seriesName: 'PFA',
  issueDate: '2025-04-19',
  dueDate: '2025-05-19',
  products: [ ... ],
};
const response = await sdk.estimates.create(payloadProforma);

Trimitere Document pe Email

await sdk.invoices.sendEmail({
  companyVatCode: 'RO12345678',
  seriesName: 'FCT',
  number: '123',
  type: 'invoice',
  to: '[email protected]',
});

References