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

lp-helper-scripts

v2.1.14

Published

A multi-tenant API library for landing pages, supporting multiple backend systems with a unified frontend interface.

Downloads

573

Readme

LP Helper Scripts

A multi-tenant API library for landing pages, supporting multiple backend systems with a unified frontend interface.

Installation

Authenticate against Gitlab NPM Repo

npm config set -- '//gitlab.com/api/v4/projects/38774892/packages/npm/:_authToken' "#auth-token#"
npm config set lp-helper-scripts:registry https://gitlab.com/api/v4/projects/38774892/packages/npm/

Install the package

npm install lp-helper-scripts
# or
yarn add lp-helper-scripts

Multi-Tenant Architecture

This library implements a multi-tenant architecture that allows the same frontend code to work with different backend systems. Currently supported backends:

  • backend1: Original implementation (default)
  • backend2: Liebeskontakte API implementation

Why Multi-Tenant?

The multi-tenant design allows:

  • Single codebase for multiple backend systems
  • Easy switching between backends via configuration
  • Consistent API interface regardless of backend
  • Field mapping and data transformation handled internally
  • No frontend code changes required when switching backends

Usage

Configuration

Configure the API once at the start of your application:

import { configureApi } from 'lp-helper-scripts';

// For backend1 (original implementation)
configureApi({
  type: 'backend1',
  baseUrl: 'https://your-api.example.com' // optional, uses window settings by default
});

// For backend2 (Liebeskontakte)
configureApi({
  type: 'backend2',
  baseUrl: 'https://dev.user-api.liebeskontakte.de', // optional
  apiToken: 'your-x-landing-token-here' // required for authentication
});

API Functions

After configuration, use the same API functions regardless of the backend:

import {
  registerUser,
  validateEmail,
  validateUsername,
  loginUser,
  getNewPassword,
  resendActivationEmail,
  getLocationAutocompleteData
} from 'lp-helper-scripts';

// Register a new user
const result = await registerUser({
  username: 'johndoe',
  email: '[email protected]',
  password: 'SecurePass123',
  gender: 'man',
  lookingfor: 'woman',
  birthday: { age: 25 },
  location: {
    country: 'DE',
    city: 'Berlin'
  }
});

// Validate email availability
const emailValid = await validateEmail('[email protected]');

// Validate username availability
const usernameValid = await validateUsername('johndoe');

// Login user
const loginResult = await loginUser({
  email: '[email protected]',
  password: 'SecurePass123'
});

// Request password reset
const resetResult = await getNewPassword('[email protected]');

// Resend activation email
const resendResult = await resendActivationEmail('[email protected]');

// Get location autocomplete suggestions
const locations = await getLocationAutocompleteData('Berlin');

Backend-Specific Notes

Backend1 (Original)

  • Uses URL parameters for GET requests
  • Requires PID from window settings
  • Returns redirect URLs in response

Backend2 (Liebeskontakte)

  • Uses JSON POST requests for all endpoints
  • Requires X-Landing-Token header for authentication
  • Automatic field mapping:
    • Gender: "woman"/"man"0/1
    • Country codes: "DE""0", "AT""1", etc.
  • Supports both standard and OCR registration flows
  • Returns platform URLs for redirects

Getting the X-Landing-Token

For backend2 (Liebeskontakte), you need to obtain an API token:

  1. Contact Liebeskontakte support for API access
  2. Request your X-Landing-Token
  3. Configure the API with your token

Field Mapping

The library automatically handles field mapping between different backend formats:

| Frontend Format | Backend1 | Backend2 (Liebeskontakte) | |----------------|----------|---------------------------| | gender: "woman" | "2" | 0 | | gender: "man" | "1" | 1 | | country: "DE" | "DE" | "0" | | country: "AT" | "AT" | "1" | | country: "CH" | "CH" | "2" |

Error Handling

All API functions return a consistent response format:

interface DefaultReturnType {
  message: string;  // Success or error message
  passed: boolean;  // True if successful, false otherwise
}

Development

Building

yarn build

Testing

yarn test

Project Structure

src/Api/
├── PublicApi.ts        # Public API interface
├── config.ts           # Configuration management
├── router.ts           # Backend routing logic
├── types.ts            # TypeScript type definitions
├── backend1/           # Backend1 implementation
│   ├── registerUser.ts
│   ├── validateUserData.ts
│   └── ...
└── backend2/           # Backend2 (Liebeskontakte) implementation
    ├── registerUser.ts
    ├── validateUserData.ts
    └── ...

License

MIT