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

@survicate/braze-bridge-npm

v1.0.1

Published

A JavaScript bridge that enables the integration between Braze In-App Messages (IAM) and Survicate surveys by handling iframe clipping and positioning

Downloads

6

Readme

@survicate/braze-bridge-npm

A JavaScript bridge that enables the integration between Braze In-App Messages (IAM) and Survicate surveys by handling iframe clipping and positioning.

Overview

This package provides a solution for allowing user interaction with the underlying page while Braze In-App Messages (IAM) Survicate Surveys are displayed. It automatically detects Braze IAM iframes and applies dynamic clipping to create transparent areas that enable page interaction.

Note: This solution is specifically designed for web platforms and does not provide this functionality for mobile SDKs (iOS/Android), which also support in-app messages.

Features

  • Automatic iframe detection: Finds Braze IAM iframes using CSS selectors
  • Dynamic clipping: Applies clip-path CSS properties to iframes based on survey positioning
  • Message handling: Listens for positioning messages from Survicate surveys
  • Responsive support: Handles window resize events to maintain proper clipping
  • Debug mode: Optional debug logging for development and troubleshooting
  • Cleanup: Proper resource cleanup and event listener removal

Installation

npm install @survicate/braze-bridge-npm

Usage

Basic Setup

import { initBrazeBridge, destroyBrazeBridge } from '@survicate/braze-bridge-npm';

// Initialize the bridge
initBrazeBridge();

// Clean up when done
destroyBrazeBridge();

With Debug Mode

import { initBrazeBridge } from '@survicate/braze-bridge-npm';

// Initialize with debug logging enabled
initBrazeBridge({
  debug: true
});

TypeScript Support

import { initBrazeBridge, destroyBrazeBridge, BrazeBridgeConfig } from '@survicate/braze-bridge-npm';

const config: BrazeBridgeConfig = {
  debug: false
};

initBrazeBridge(config);

How It Works

  1. Initialization: The bridge sets up event listeners for window messages and resize events
  2. Iframe Detection: Uses a MutationObserver to detect when Braze IAM iframes are added to the DOM
  3. Message Handling: Listens for sv__rect messages from Survicate surveys containing positioning data
  4. Clipping Application: Applies CSS clip-path properties to the iframe based on the received positioning data
  5. Responsive Updates: Re-applies clipping when the window is resized

API Reference

Functions

initBrazeBridge(config?: BrazeBridgeConfig): void

Initializes the Braze bridge with optional configuration.

Parameters:

  • config (optional): Configuration object
    • debug?: boolean - Enable debug logging (default: false)

destroyBrazeBridge(): void

Cleans up the bridge, removes event listeners, and resets iframe styles.

Types

BrazeBridgeConfig

interface BrazeBridgeConfig {
  debug?: boolean;
}

License

MIT © Survicate