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

@xmz-ai/gitlab-webhook-bridge

v0.2.0

Published

Standalone GitLab webhook bridge with GitHub-compatible fanout and GitLab pipeline delivery.

Readme

GitLab Webhook Bridge

Standalone GitLab webhook bridge library. It verifies GitLab webhook requests, normalizes supported GitLab events, fans out built-in normalized events, and delivers them to configured targets.

Install

npm install @xmz-ai/gitlab-webhook-bridge

Basic Usage

import {
  GitLabWebhookBridge,
  gitlabPipelineTarget,
} from '@xmz-ai/gitlab-webhook-bridge';

const bridge = new GitLabWebhookBridge({
  gitlab: {
    baseUrl: 'https://git.example.com',
    token: process.env.GITLAB_TOKEN!,
    webhookSecret: process.env.GITLAB_WEBHOOK_SECRET,
  },
  targets: [
    gitlabPipelineTarget(),
  ],
});

const result = await bridge.handle({
  headers: req.headers,
  body: req.body,
});

API

  • bridge.normalize(input) verifies and parses a GitLab webhook without delivering targets.
  • bridge.trigger({ deliveryId, events }) delivers pre-normalized events.
  • bridge.handle(input) runs the full verify -> normalize -> fanout -> target delivery flow.
  • gitlabPipelineTarget() delivers normalized events by creating or reusing a GitLab project pipeline trigger token and then triggering a pipeline. If no variable mapper is configured, it sends defaultVariables().
  • gitlabPipelineTarget({ createTriggerIfMissing: false }) reuses cached or existing GitLab project pipeline trigger tokens and fails when none is available.
  • gitlabPipelineTarget({ variablePrefix: 'AGENTRIX_' }) renames the default mapper output without replacing the mapper. The default prefix is GITLAB_BRIDGE_*.
  • gitlabPipelineTarget({ forwardTriggerPipelines: true }) also forwards GitLab pipeline webhooks whose source is trigger. By default these are ignored by pipeline delivery to avoid recursive trigger loops.
  • deliveryTarget(name, handler, { onError }) adapts a delivery-level handler into a BridgeDeliveryTarget, with optional ignored-error behavior for best-effort sinks such as inbox fan-out.
  • defaultVariables({ prefix }) maps normalized events to prefixed pipeline variables. By default it emits GITLAB_BRIDGE_*.
  • memoryStore() provides in-memory delivery dedupe and trigger-token caching for development and tests. Host applications can pass their own store or gitlabClient to integrate existing persistence and GitLab access layers.

Supported webhook classes:

  • GitLab branch creation/deletion pushes -> create / delete
  • GitLab issues -> issues.*
  • GitLab merge requests -> pull_request.* / pull_request_review.*
  • GitLab non-system notes -> issue_comment.* / pull_request_review_comment.*
  • GitLab pipelines -> workflow_run.*

By default, system notes and unsupported provider-specific events are ignored. Pipeline webhooks from source=trigger are normalized as workflow_run.* events, but gitlabPipelineTarget() ignores them unless forwardTriggerPipelines is enabled.

Tests

npm test
npm run typecheck
npm run build

The live GitLab E2E test is skipped unless explicitly enabled:

RUN_GITLAB_E2E=1 npm run test:e2e

The E2E test reads GITLAB_BASE_URL, GITLAB_TOKEN, GITLAB_TEST_PROJECT, and optional GITLAB_TEST_REF from the environment. If they are not set, it can fall back to /Users/alex/git/github/nil4u/issue-flow/.env on this machine.

Publishing

The package is published as @xmz-ai/gitlab-webhook-bridge to the public npm registry.

Local release checks:

npm run verify
npm run publish:dry-run