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

@bygd/opus-hl

v0.1.6

Published

## Introduction

Readme

@bygd/opus-hl

Introduction

The @bygd/opus-hl project provides a script that manages header bidding configurations for web applications. It helps simplify the integration and configuration process for header bidding solutions, potentially optimizing ad revenue for publishers. This utility dynamically loads and configures header bidding scripts based on specific site configurations and targeting criteria.

How It Works

@bygd/opus-hl operates by loading a set script for header bidding and configuring it according to the page's parameters and targetings, such as the page URL and specific targeting keys for advertisements. It overrides certain aspects of configuration to align advertising slots with the site's requirements and makes it possible to customize how ads are served, including altering slot sizes and targeting keys.

Key Features

  • Dynamic Script Loading: Automatically loads the header bidding script from a specified source, ensuring up-to-date configurations.
  • Configurable Bid Adjustments: Allows modification of configuration options like slot sizes and targeting adjustments for better ad placements.
  • Supports Geo-Targeting and Slot Customization: Adjust advertisement slots dynamically based on location and user-provided targeting data.
  • Caches Configuration: Maintains a cached instance, optimizing repeated initializations and reducing unnecessary overhead on repeated page loads.

Conclusion

@bygd/opus-hl offers a straightforward way to integrate and manage header bidding solutions on web pages. By providing an easy-to-use interface for configuring ad slots and targeting attributes, it facilitates a smoother ad revenue optimization process for web publishers.

@bygd/opus-hl Developer Guide

Overview

The @bygd/opus-hl library is designed to assist developers in managing and optimizing header bidding configurations for web pages. It integrates with different advertising scripts and platforms to streamline the advertisement setup process. The main features include setting up and merging configurations for dynamic ad loading and targeting on web pages, with support for video ad slots.

Installation

To install the @bygd/opus-hl library, use either npm or yarn package manager:

npm install @bygd/opus-hl

or

yarn add @bygd/opus-hl

Usage

Below is an example of how you can initialize and use the @bygd/opus-hl library in a typical web application setting:

Initialization

First, you need to import and initialize the library in your script:

import opusHL from '@bygd/opus-hl';

const initializeHeaderLift = async () => {
  try {
    const hlInstance = await opusHL({
      pageUrl: window.location.href,
      gptTargeting: { key1: 'value1', key2: 'value2' }, // replace with actual targeting keys and values
      config: userProvidedConfig // replace with any user-defined configuration or omit to use the default
    });
    
    console.log('Header Lift Initialized:', hlInstance.config);
  } catch (error) {
    console.error('Failed to initialize Header Lift:', error);
  }
};

initializeHeaderLift();

Merging Configurations

If you need to merge additional configurations such as video targeting information or updates on page URL, you can use the mergeWith function:

const mergeAdditionalConfig = async () => {
  try {
    const hlInstance = await opusHL(); // Retrieve the cached instance

    await hlInstance.mergeWith({
      pageUrl: "https://example.com/new-page",
      gameId: "your-game-id",
      videoTargeting: { vidKey1: 'vidValue1', vidKey2: 'vidValue2' }
    });

    console.log('Configurations Merged:', hlInstance.config);
  } catch (error) {
    console.error('Failed to merge configurations:', error);
  }
};

mergeAdditionalConfig();

Examples

Basic Configuration

To set up a basic header lift configuration with default settings:

opusHL({ pageUrl: 'https://example.com' });

Custom GPT Targeting

To apply custom Google Publisher Tag (GPT) targeting:

opusHL({
  gptTargeting: {
    age: '25-34',
    interests: 'technology'
  }
});

Merge and Update Dynamic Content

To update and refine configurations based on user interactions or page changes:

hlInstance.mergeWith({
  gameId: 'new-game-id',
  videoTargeting: {
    category: 'gaming',
    viewer: 'enthusiast'
  }
});

Acknowledgement

Special thanks to the contributors who support and maintain this library, helping to make header bidding configurations more efficient and manageable for developers on various platforms.

Input Schema

$schema: https://json-schema.org/draft/2020-12/schema
type: object
properties:
  pageUrl:
    type: string
    format: uri
    description: The URL of the page. Defaults to the current window's location.
  gptTargeting:
    type: object
    additionalProperties:
      type: string
    description: Custom GPT targeting properties.
  config:
    type: object
    description: User-provided configuration object to override default settings.
    properties:
      dfp:
        type: object
        properties:
          gpt:
            type: object
            properties:
              slots:
                type: object
                additionalProperties:
                  type: object
                  properties:
                    isDfpBidding:
                      type: boolean
                      default: true
                    collapseEmptyDiv:
                      type: boolean
                      default: false
                    targeting:
                      type: array
                      items:
                        type: array
                        items:
                          type: string
      hbw:
        type: object
        properties:
          initGpt:
            type: boolean
            default: true
          minRefreshRate:
            type: number
            description: Minimum refresh rate in milliseconds.
            default: 3600000
          slots:
            type: object
            additionalProperties:
              type: object
              properties:
                sizes:
                  type: array
                  items:
                    type: array
                    items:
                      type: number
  prebid:
    type: object
    additionalProperties:
      type: object
      properties:
        slots:
          type: object
          additionalProperties:
            type: object
            properties: {}
required: []