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

saafe-non-aa-sdk

v0.1.1

Published

A secure, lightweight, customizable React iframe SDK for non-AA applications

Downloads

27

Readme

Saafe Non-AA SDK

A secure, lightweight, customizable React iframe SDK to render any application in an iframe.

Features

  • 🔒 Secure iframe communication with PostMessage API
  • 🎨 Style-safe - no CSS leakage or DOM conflicts
  • 📱 Supports popup modal mode with clean UI
  • 🧩 Full TypeScript support
  • 🪶 Lightweight (<50KB minified + gzipped)
  • ⚛️ Compatible with React 16.8+ (using hooks)

Installation

npm install saafe-non-aa-sdk
# or
yarn add saafe-non-aa-sdk

Usage

Component API

import { RedirectNonAA } from 'saafe-non-aa-sdk';

function MyComponent() {
  const handleComplete = (data) => {
    console.log('Journey completed with data:', data);
  };

  const handleCancel = () => {
    console.log('Journey was cancelled');
  };

  return (
    <div>
      <h1>My Application</h1>
      
      <RedirectNonAA 
        url="http://localhost:5001"
        queryParams={{
          fi: "YXBxcncdVFxEHUVUQQ==",
          reqdate: "210420251005562",
          ecreq: "BUAO4s74gDvweksQVC9qjlRUZdZam2XZcYs3WxBsPEkGqrNGf4Ed-94CQQUHzNaLywXJjVZ8WyeZ5oDZBC556PLUm0mjdgK2v070_Y5UEfVe8OiVBFCaXBEk-TZCG4uj-IWjN_ZcKh-UT5RwtqpbXI4GYg4UN1O5rCqnr4IYsjzpD3cH-f9SNXDlJbo579cdAOHItRBEvYPDoRBQ4WJoEZZhFjSiRXxziTGeIxPHE4z5U0NPpYoQm676FaCwz6gXWpn7ARAx7Kk9irOQ09FqfMWevGMP_O9P6hOFjxNmulygXcXnI7DZtlUGG5wf2OlG"
        }}
        mode="popup"
        width="80%" 
        height="80%"
        buttonProps={{
          text: "Start Journey",
          className: "my-button",
          style: { backgroundColor: "blue", color: "white" }
        }}
        onLoad={() => console.log('Iframe loaded')}
        onComplete={handleComplete}
        onCancel={handleCancel}
        onError={(err) => console.error('Error:', err)}
      />
    </div>
  );
}

Programmatic API

import { triggerRedirect } from 'saafe-non-aa-sdk';

function MyComponent() {
  const startJourney = () => {
    const instance = triggerRedirect({
      url: "http://localhost:5001",
      queryParams: {
        fi: "YXBxcncdVFxEHUVUQQ==",
        reqdate: "210420251005562",
        ecreq: "BUAO4s74gDvweksQVC9qjlRUZdZam2XZcYs3WxBsPEkGqrNGf4Ed-94CQQUHzNaLywXJjVZ8WyeZ5oDZBC556PLUm0mjdgK2v070_Y5UEfVe8OiVBFCaXBEk-TZCG4uj-IWjN_ZcKh-UT5RwtqpbXI4GYg4UN1O5rCqnr4IYsjzpD3cH-f9SNXDlJbo579cdAOHItRBEvYPDoRBQ4WJoEZZhFjSiRXxziTGeIxPHE4z5U0NPpYoQm676FaCwz6gXWpn7ARAx7Kk9irOQ09FqfMWevGMP_O9P6hOFjxNmulygXcXnI7DZtlUGG5wf2OlG"
      },
      mode: 'popup',
      width: '80%',
      height: '80%',
      onComplete: (data) => console.log('Journey completed with data:', data),
      onCancel: () => console.log('Journey was cancelled'),
      onError: (err) => console.error('Error:', err)
    });
    
    // You can close the journey programmatically
    // instance.close();
  };

  return (
    <div>
      <h1>My Application</h1>
      <button onClick={startJourney}>Start Journey</button>
    </div>
  );
}

URL Construction

The SDK dynamically constructs the URL using the provided url and queryParams:

{url}?{queryParams as URLSearchParams}

For example:

http://localhost:5001?fi=YXBxcncdVFxEHUVUQQ==&reqdate=210420251005562&ecreq=BUAO4s74gDvweksQVC9qjlRUZdZam2XZcYs3WxBsPEkGqrNGf4Ed-94CQQUHzNaLywXJjVZ8WyeZ5oDZBC556PLUm0mjdgK2v070_Y5UEfVe8OiVBFCaXBEk-TZCG4uj-IWjN_ZcKh-UT5RwtqpbXI4GYg4UN1O5rCqnr4IYsjzpD3cH-f9SNXDlJbo579cdAOHItRBEvYPDoRBQ4WJoEZZhFjSiRXxziTGeIxPHE4z5U0NPpYoQm676FaCwz6gXWpn7ARAx7Kk9irOQ09FqfMWevGMP_O9P6hOFjxNmulygXcXnI7DZtlUGG5wf2OlG

API Reference

RedirectNonAA Props

| Prop | Type | Required | Default | Description | |------|------|----------|---------|-------------| | url | string | Yes | - | The URL to load in the iframe | | queryParams | Record<string, string> | No | - | Query parameters to append to the URL | | mode | 'embedded' | 'popup' | No | 'popup' | Mode of the redirect | | width | string | number | No | '80%' | Width of the iframe | | height | string | number | No | '80%' | Height of the iframe | | buttonProps | ButtonProps | No | {} | Props for the trigger button | | onLoad | () => void | No | - | Callback when the iframe is loaded | | onComplete | (data: any) => void | No | - | Callback when the journey is completed | | onCancel | () => void | No | - | Callback when the journey is cancelled | | onError | (error: Error) => void | No | - | Callback when an error occurs |

ButtonProps

| Prop | Type | Required | Default | Description | |------|------|----------|---------|-------------| | text | string | No | 'Start Journey' | Text to display on the button | | className | string | No | - | CSS class for the button | | style | CSSProperties | No | - | Inline styles for the button | | children | ReactNode | No | - | Custom content for the button |

triggerRedirect Options

Same as RedirectNonAA props, but without buttonProps. Additionally:

| Prop | Type | Required | Default | Description | |------|------|----------|---------|-------------| | container | HTMLElement | No | document.body | Container element to render the iframe in (only for embedded mode) |

Security Features

  • Uses sandbox attribute on iframes with minimal required permissions
  • Validates origin of incoming messages
  • Passes token parameters securely
  • Uses CSS modules to prevent style leakage

License

MIT