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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@fitko/fit-connect

v1.0.2

Published

FIT-Connect JavaScript-SDK

Readme

Browser Support license

FIT-Connect JavaScript SDK

The FIT-Connect JavaScript SDK enables simple and secure integration of FIT-Connect into modern web applications. It supports the creation, encryption, and transmission of submissions as well as secure end-to-end encrypted communication with the FIT-Connect backend.

Target Audience

  • Developers who want to use FIT-Connect in JavaScript/TypeScript projects
  • Government agencies and service providers implementing digital application processes

Features

  • Create and validate submissions
  • Encryption and signing of business data and metadata
  • Sending attachments
  • Communication with FIT-Connect endpoints (Send Submission, Retrieve Public Key)

Installation

npm install @fitko/fit-connect

Quick Start

1. Create and Send a Submission

import { Submission, SubmissionSender } from '@fitko/fit-connect';

// 1. Initialize Submission Builder
const submission = Submission.builder()
  // Target authority (Destination ID)
  .setDestination('404d5b8f-c0b8-4ef7-916a-48da53f06570')
  // Service Type from LeiKa catalog
  .setServiceType('urn:de:fim:leika:leistung:99400048079000', 'My Service')
  // JSON data with schema validation
  .setJsonData({ data: 'Application data' }, 'https://my-schema.de/schema.json')
  // Optional: Add attachments
  .addAttachments([file])
  .build();

// 2. Configure SubmissionSender
const sender = new SubmissionSender({
  publicKeyUrl: 'https://fit-connect-backend.net/api/keys/{destinationId}',
  submissionUrl: 'https://fit-connect-backend.net/api/submit'
});

// 3. Send submission
const sentSubmission = await sender.sendSubmission(submission);
console.log('Submission-Response:', sentSubmission);

2. Using XML Data

// Alternative: XML data instead of JSON
const submission = Submission.builder()
  .setDestination('404d5b8f-c0b8-4ef7-916a-48da53f06570')
  .setServiceType('urn:de:fim:leika:leistung:99400048079000', 'My Service')
  .setXmlData('<root><data>Application data</data></root>', 'https://my-schema.de/schema.xml')
  .build();

Configuration

SubmissionSender Configuration

The SubmissionSender offers various configuration options:

interface BackendConfig {
  // Required fields
  publicKeyUrl: string;             // URL for the GET endpoint to retrieve the Destination's encryption key
  submissionUrl: string;            // URL for the POST endpoint to send a submission

  // Optional configurations
  timeout?: number;                 // Timeout in milliseconds (Default: 30000)
  retryAttempts?: number;           // Number of retry attempts (Default: 3)
  retryDelay?: number;              // Delay between retries in ms (Default: 1000)
}

Example: Complete Configuration

const sender = new SubmissionSender({
  publicKeyUrl: 'https://fit-connect-backend.net/api/keys/{destinationId}',
  submissionUrl: 'https://fit-connect-backend.net/api/submit',

  timeout: 60000,            // 60 seconds timeout
  retryAttempts: 5,          // 5 retry attempts
  retryDelay: 2000,          // 2 seconds between retries
});

Configuration Options in Detail

| Option | Type | Default | Description | |--------|-----|---------|------------------------------------------------------------------------| | publicKeyUrl | string | - | URL for the GET endpoint to retrieve the destination's encryption key. | | submissionUrl | string | - | URL for the POST endpoint to send a submission. | | timeout | number | 30000 | Maximum wait time for HTTP requests in milliseconds. | | retryAttempts | number | 3 | Number of retry attempts for failed requests. | | retryDelay | number | 1000 | Wait time between retry attempts in milliseconds. |

Custom Headers

You can add custom headers to your submission request by passing them to the sendSubmission method:

const sender = new SubmissionSender({
    publicKeyUrl: 'https://fit-connect-backend.net/api/keys/{destinationId}',
    submissionUrl: 'https://fit-connect-backend.net/api/submit'
});

// Send submission with custom headers
const sentSubmission = await sender.sendSubmission(submission, {
    headers: {
        'X-Custom-Header': 'custom-value',
        'Authorization': 'Bearer your-token'
    }
});

The headers will be added to the submission request. This is useful for:

  • Adding authentication tokens
  • Setting custom tracking headers
  • Adding organization-specific identifiers

Backend Integration with FIT-Connect

Due to CORS restrictions (Cross-Origin Resource Sharing), the frontend cannot communicate directly with the FIT-Connect backend. Therefore, a separate backend is required to act as a proxy between the frontend and the FIT-Connect backend.

Backend Requirements

The backend must provide endpoint paths with the following pattern:

  • GET /keys/{destinationId} - Retrieve the Public Key
  • POST /submit - Submit the submission as multipart/form

An OpenAPI specification of the required backend endpoints can be found under /docs/openapi.yaml.

Reference Backend

FITKO provides a reference backend application that serves as a reference implementation:

  • Repository: Java Reference Online Service
  • This implementation demonstrates how a backend can provide the necessary endpoints and communicate with the FIT-Connect backend
  • The reference application can be used as a basis for your own backend implementations

:warning: The reference backend application is provided as a demonstration. When using it in production, ensure all security measures are properly implemented and configured

For further information on the integration with a backend application see the official documentation.

Further Documentation

Important Notes

  • For production use: Please observe the security notices and current FIT-Connect documentation.
  • For questions or issues, please contact the FIT-Connect team or use the official support channels.
  • Ensure you are using the latest version of the SDK.
  • Thoroughly test your integration in the test environment before going into production.

License

Source code is licensed under the EUPL.

Legal Notice: This Software Development Kit (SDK) is intended to enable the connection of software to the FIT-Connect infrastructure. For this purpose, the SDK can be integrated into the software to be connected. If the SDK is integrated in unmodified form, there is no adaptation within the meaning of the EUPL or German copyright law. The manner of linking the SDK does not create a derivative work in particular. The unmodified adoption of the SDK into software to be connected does not therefore mean that the software to be connected must be licensed under the terms of the EUPL. For the distribution of the SDK itself - in unmodified or modified form, as source code or executable program - the license terms of the EUPL apply unchanged.