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 🙏

© 2024 – Pkg Stats / Ryan Hefner

fiskaly-sdk-node

v1.2.102

Published

fiskaly Cloud-TSE SDK for Node.js

Downloads

51

Readme

fiskaly SDK for Node.js

The fiskaly SDK includes an HTTP client that is needed1 for accessing the kassensichv.io API that implements a cloud-based, virtual CTSS (Certified Technical Security System) / TSE (Technische Sicherheitseinrichtung) as defined by the German KassenSichV (Kassen­sich­er­ungsver­ord­nung).

Supported Versions

  • Node 8.0+

Features

  • [X] Automatic authentication handling (fetch/refresh JWT and re-authenticate upon 401 errors).
  • [X] Automatic retries on failures (server errors or network timeouts/issues).
  • [ ] Automatic JSON parsing and serialization of request and response bodies.
  • [X] Future: [1] compliance regarding BSI CC-PP-0105-2019 which mandates a locally executed SMA component for creating signed log messages.
  • [ ] Future: Automatic offline-handling (collection and documentation according to Anwendungserlass zu § 146a AO)

Integration

NPM

The Node.js SDK is available for a download via NPM.

Package Repository.

Simply execute this command from the shell in your project directory:

$ npm install fiskaly-sdk-node --save

Or you can manually add the package to your package.json file:

"dependencies": {
  "fiskaly-sdk-node": "*"
}

then run

$ npm install

Finally, be sure to include the sdk in your code:

const { FiskalyClient } = require('fiskaly-sdk-node');

Service

Additionally, to the SDK, you'll also need the fiskaly service. Follow these steps to integrate it into your project:

  1. Go to https://developer.fiskaly.com/downloads#service
  2. Download the appropriate service build for your platform
  3. Start the service

Client

Additionally to the service, Node SDK, support also fiskaly client. The client library is used if your constructor parameter "fiskalyServiceUrl" is not provided.

Follow these steps to integrate it into your project:

  1. Go to https://developer.fiskaly.com/downloads#client
  2. Download the appropriate client library for your platform
  3. Move it to node_modules/fiskaly-sdk-node/lib/client/ directory

SDK Usage

Demo

// Environment variables
const { FISKALY_SERVICE_URL, FISKALY_API_KEY, FISKALY_API_SECRET, FISKALY_BASE_URL } = process.env;

try {
  // SDK Setup
  const client = new FiskalyClient(FISKALY_SERVICE_URL);
  await client.createContext(FISKALY_API_KEY, FISKALY_API_SECRET, FISKALY_BASE_URL);

  const version = await client.getVersion();
  console.log("Version", version);
} catch (e) {
  // Handle Error
  console.error(e);
}

Client Configuration

The SDK is built on the fiskaly Client which can be configured through the SDK.

A reason why you would do this, is to enable the debug mode.

Enabling the debug mode

The following code snippet demonstrates how to enable the debug mode in the client.

try {
  const configParams = {
    debug_level: 3,
    debug_file: __dirname + '/../fiskaly.log',
    client_timeout: 5000,
    smaers_timeout: 2000,
  }
  const newConfig = await client.configure(configParams);
} catch (e) {
  // Handle Error
  console.error(e);
}

Related