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

@vergelijkdirect/insurance-transmission-client

v1.3.67

Published

Partner-facing JavaScript/TypeScript client for the Vergelijkdirect Insurance Transmission API.

Downloads

1,145

Readme

Insurance Transmission Client

Partner-facing JavaScript/TypeScript client for the Vergelijkdirect Insurance Transmission API.

Use this client to request insurance rates from all partner-enabled providers in one flow, receive one combined RateCollection, work with normalized rate models, store selected offers, and call supporting API services for comparison sessions, vehicle data, documents, validation, packages, loans, partner data, and lookups.

What It Can Do

  • Send one category request through the comparison API and collect rates from all enabled providers, such as Moneyview, RISK, Rolls, or Vergelijkdirect, based on the allowed partner/funnel configuration.
  • Request rates for supported insurance categories and merge provider responses into a RateCollection.
  • Read normalized rate data such as company name, price, coverage, documents, raw API data, and provider-specific additional coverages.
  • Store selected rates in browser localStorage through LocalStorageAdapter, or through any custom adapter implementing StorageInterface.
  • Create, retrieve, update, and recalculate comparison sessions.
  • Calculate insurance packages and package discounts.
  • Validate common data such as email/address, phone, IBAN, and zipcode.
  • Retrieve supporting data such as vehicle details, license-plate checks, caravan catalog data, pet breeds/filters, KvK data, SBI data, loan files, Moneyview documents, Google reviews, and partner metadata.

API Version

Use API v2.1 for partner integrations:

const config = {
  api: {
    baseUrl: 'https://api.vergelijkdirect.com/api',
    version: 'v2.1',
    credentials: {
      accessKey: 'your-partner-access-key',
      secret: 'your-partner-secret',
    },
  },
};

Category comparison services build their base URL from this value:

{baseUrl}/{version}/comparisons/{category}

With the recommended configuration, moped rates are called through:

https://api.vergelijkdirect.com/api/v2.1/comparisons/moped

Existing v2 integrations can keep using the client without partner credentials:

await client.configure({
  api: {
    baseUrl: 'https://api.vergelijkdirect.com/api',
    version: 'v2',
  },
});

Partner Credentials

Partner credentials are optional on the client. Use them for Partner API v2.1 integrations; omit them for existing v2 integrations that do not require partner authentication.

Partner API v2.1 uses the same credentials as the Vergelijkdirect Partner API documentation. Configure them once on the client and every service request will include the partner credential headers automatically:

await client.configure({
  api: {
    baseUrl: 'https://api.vergelijkdirect.com/api',
    version: 'v2.1',
    credentials: {
      accessKey: 'your-partner-access-key',
      secret: 'your-partner-secret',
    },
  },
});

By default the client sends:

X-Partner-Access-Key: your-partner-access-key
X-Partner-Secret: your-partner-secret

If an integration needs HTTP Basic authentication instead, set authType to basic. Use both only when a gateway or migration flow requires both authentication formats.

credentials: {
  accessKey: 'your-partner-access-key',
  secret: 'your-partner-secret',
  authType: 'basic', // headers, basic, or both
}

Some helper resources still use fixed API paths in the client, for example /v2/data, /v2/package, /v2/user, /v2/comparison, /v1 validation and legacy endpoints, /partner, and /scripts/comparison-module. If those backend endpoints are migrated to v2.1, update the related resource base URL before sharing a new client build.

Installation

npm install @vergelijkdirect/insurance-transmission-client

For private distribution, install from the package registry or Git URL provided by Vergelijkdirect.

The published package entry points to compiled CommonJS files in src/js, so run npm run compile before packaging or publishing a new build.

Quick Start

Initialize the client before creating API services:

import {
  InsuranceTransmissionClient,
  LocalStorageAdapter,
  MopedService,
} from '@vergelijkdirect/insurance-transmission-client';

const storage = new LocalStorageAdapter('itc:selected-rates');
const client = new InsuranceTransmissionClient(storage);

await client.configure({
  api: {
    baseUrl: 'https://api.vergelijkdirect.com/api',
    version: 'v2.1',
    credentials: {
      accessKey: 'your-partner-access-key',
      secret: 'your-partner-secret',
    },
  },
});

const mopedService = new MopedService();

const rates = await mopedService.getRates({
  CommencingDate: '2026-06-09',
  LicensePlate: 'D251LG',
  TypeOfMoped: '63',
  MopedSignCode: '4872',
  Coverage: '1',
  CatalogValue: 1099,
  ValueAccessories: 0,
  DriverZipCode: '5803DE',
  DriverHouseNumber: '41',
  DriverBirthdate: '1980-06-16',
  ClaimFreeYears: '0',
  BrokerID: '05250',
  ReturnProvision: '0,00',
  IncludeXml: false,
});

const selectedRate = rates.first();

console.log(selectedRate.getCompanyName());
console.log(selectedRate.getPrice());
console.log(selectedRate.getCoverage());

client.saveNew(selectedRate);

Use complete request payloads from the API contract for production calls. Example development payloads are available in src/requests.

Using the Service Factory

When the category is dynamic, use ApiServiceFactory:

import {
  ApiServiceFactory,
  InsuranceTransmissionClient,
  LocalStorageAdapter,
} from '@vergelijkdirect/insurance-transmission-client';

const client = new InsuranceTransmissionClient(new LocalStorageAdapter('itc'));

await client.configure({
  api: {
    baseUrl: 'https://api.vergelijkdirect.com/api',
    version: 'v2.1',
    credentials: {
      accessKey: 'your-partner-access-key',
      secret: 'your-partner-secret',
    },
  },
});

const category = 'car';
const service = ApiServiceFactory.get(category);
const rates = await service.getRates(requestPayload);

for (const rate of rates) {
  console.log(rate.getCompanyName(), rate.getPrice());
}

Supported factory categories are:

moped, motor, pet, home, caravan, bike, household, liability,
legal-assistance, car-business, car, travel, package, housing, loan

Most of these services expose getRates. PackageService is returned by the same factory, but uses package-specific methods such as calculatePackage, calculatePackages, requestPackage, and annualDiscount.

Rate Results

Most rate calls return a RateCollection.

const count = rates.count();
const first = rates.first();
const last = rates.last();
const all = rates.all();
const rawRates = rates.toObject();

for (const rate of rates) {
  const company = rate.getCompanyName();
  const price = rate.getPrice();
  const coverage = rate.getCoverage();
  const raw = rate.getData();
  const documents = await rate.getDocuments();

  console.log(company, price, coverage, raw, documents.getConditionUrls());
}

Provider-specific rate models can expose additional helper methods such as getAdditionalCoverages. For strongly typed integrations, the matching service method can also be used directly, for example getRiskAdditionalCoverages, getMoneyviewAdditionalCoverages, or getVergelijkdirectAdditionalCoverages.

Selected Rate Storage

InsuranceTransmissionClient stores selected rate data through the adapter passed to its constructor.

client.save(rate);               // append a selected rate for its category
client.saveNew(rate);            // replace previous selected rates for that category
client.get('moped').first();      // read selected moped rate
client.get('moped').count();      // count selected moped rates
client.remove('moped');           // clear selected moped rates

LocalStorageAdapter is browser-oriented and uses window.localStorage. For Node, SSR, or custom persistence, provide an adapter with get, save, put, remove, and all methods.

Supported Categories and Providers

The comparison module can override the enabled provider list per funnel. If no remote configuration is available, the client falls back to these built-in providers:

| Category | Built-in providers | Notes | | --- | --- | --- | | moped | risk, moneyview, vergelijkdirect, enra, unigarant | Rates, coverage comparison, vehicle find/check, additional coverages | | motor | risk, moneyview, rolls, voogd | Rates, coverage comparison, vehicle find/check, additional coverages | | car | risk, moneyview, rolls, ominimo, voogd | Rates, vehicle find/check, additional coverages | | car-business | risk, rolls, voogd | Rates, Rolls business info, additional coverages | | bike | risk, laka, enra, vergelijkdirect, fietszeker | Rates and Enra rate lookup | | caravan | risk | Rates, coverage comparison, brands, models, types, catalog price | | pet | petsecur | Rates, additional coverages, breeds, filters | | home | risk, moneyview, rolls | Rates, home amount, find, addition | | household | risk, moneyview, rolls | Rates and insured amount | | housing | risk, moneyview, rolls | Rates and direct Moneyview rates | | liability | risk, moneyview, nn | Rates | | legal-assistance | risk, moneyview, vergelijkdirect | Rates and additional coverages | | travel | risk, vergelijkdirect, moneyview | Rates and additional coverages | | loan | dkm | Rates, field values, loan request |

Other Services

| Service | Purpose | | --- | --- | | ComparisonService | Create, get, update, and persist comparison sessions | | PackageService | Calculate packages, discounts, annual discounts, package requests, and package saves | | DataService | Vehicle lookup/checks, IBAN validation, maximum loan amount, loan documents, KvK search/profile/SBI, Kickbite tracking | | DataValidationService | Email/address, phone, IBAN, and zipcode validation | | DocumentService | Moneyview document lists and document models | | PartnerService | Partner info and partner API version | | ComparisonModuleService | Comparison-module initialization data and script source | | GoogleService | Google reviews | | UserService | User creation | | V1Service | Legacy pet, health, bike, and car endpoints |

Comparison Sessions

After client.configure(...), comparison sessions can be loaded and updated:

import { ComparisonService } from '@vergelijkdirect/insurance-transmission-client';

const comparisonService = new ComparisonService();

const comparison = await comparisonService.get('65a7942e29a57');
const data = comparison.getData();
const user = comparison.getUser();

console.log(comparison.getId(), comparison.getFunnel(), data.all(), user);

const updatedComparison = await comparisonService.update(comparison);

When a comparison is loaded, the client stores the comparison funnel in the injector. Category calls made afterwards include the X-Comparison-Funnel header so the API can resolve funnel-specific provider configuration.

Development

Install dependencies:

npm install

Run the TypeScript build:

npm run compile

Run tests:

npm test

Run one Jest test by name:

npm run test -- api --testNamePattern="VehicleData"

Browser Testing

Some behavior should be verified in a real browser because browser fetch, CORS, and localStorage can differ from the Node/Jest environment.

Install Browserify if needed:

npm install -g browserify

Compile the client and build a browser test bundle:

npm run compile
npm run browserify --arg=comparison

Open src/tests/browser/index.html in a browser, open the console, and call:

makeItcCall();

Change the relevant src/tests/browser/*.webtest.js file or JSON payload in src/tests/browser/requests when testing a specific flow.

Partner Integration Checklist

  • Configure baseUrl for the target API environment.
  • Configure api.version as v2.1.
  • Call client.configure(...) before constructing API services.
  • Use complete payloads from the API contract, with category-specific PascalCase fields.
  • Pass partner/broker fields required by the API, such as BrokerID, PartnerId, and provision/payment fields where applicable.
  • Use RateCollection and rate model helpers for display and selection.
  • Store selected rates through saveNew when only one selected rate per category should exist.
  • Browser integrations must provide window, localStorage, and a CORS-enabled API endpoint.
  • Before publishing to partners, run npm test and npm run compile.