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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@utrecht/flo-legal-decision-tree-client

v1.0.2

Published

Flo legal Decision Tree client assets for Utrecht Design System (compatible with flo-client-plugin v1.13.2)

Downloads

326

Readme

@utrecht/flolegal-decision-tree-client

Flo client assets and utilities for the Utrecht Design System. Compatible with Flo Client Plugin v1.13.2

Installation

npm install @utrecht/flolegal-decision-tree-client

Usage

Basic Usage

import { loadFloClientScript } from "@utrecht/flolegal-decision-tree-client";
import "@utrecht/flolegal-decision-tree-client/dist/assets/flo-client-styles.1.13.2.css";

// Load the script
await loadFloClientScript("./");

With CSP Nonce

import { loadFloClientScript } from "@@utrecht/flolegal-decision-tree-client";

await loadFloClientScript("./", { nonce: "your-csp-nonce" });

With Integrity Check

import { loadFloClientScript } from "@utrecht/flolegal-decision-tree-client";

await loadFloClientScript("./", {
  integrity: "sha384-your-hash",
  nonce: "your-csp-nonce",
});

Storybook Usage

For Storybook, configure it to serve the static assets:

1. Add to .storybook/main.js or .storybook/main.ts:

module.exports = {
  // ... other config
  staticDirs: ["../node_modules/@utrecht/flolegal-decision-tree-client/assets"],
};

2. Use in your stories:

import { loadFloClientScript } from "@utrecht/flolegal-decision-tree-client";

export const MyStory = () => {
  const [ready, setReady] = useState(false);

  useEffect(() => {
    loadFloClientScript().then(() => setReady(true));
  }, []);

  if (!ready) return <div>Loading...</div>;
  return <FloDecision checkData="..." />;
};

Next.js Usage

For Next.js applications, copy the script to your public directory and use the next/script component:

1. Add to your package.json:

{
  "scripts": {
    "copy:flo-plugin": "cp node_modules/@utrecht/flolegal-decision-tree-client/assets/flo-client-plugin.1.13.2.js ./public",
    "postinstall": "yarn copy:flo-plugin"
  }
}

2. If you have a custom middleware.ts, update the config:

export const config = {
  matcher: ["/((?!api|_next/static|_next/image|assets|favicon.ico|sw.js|.*\\.js$).*)"],
};

3. Use in your component:

import Script from "next/script";

export default function MyPage() {
  return (
    <>
      <Script src="/flo-client-plugin.1.23.2.js" nonce={nonce} />
      {/* Your component content */}
    </>
  );
}

API

loadFloClientScript(basePath, options)

Loads the Flo client JavaScript file.

Parameters:

  • basePath (string): Base path for the script file (default: '')
  • options (LoadScriptOptions): Configuration options

Options:

  • nonce (string): CSP nonce for the script tag
  • integrity (string): Subresource integrity hash
  • useNextScript (boolean): Flag for Next.js compatibility warning

CSP Compatibility

The package supports Content Security Policy (CSP) through:

  • Nonce support for script tags
  • Integrity hashes for subresource integrity

Next.js Compatibility

The package works with Next.js by copying the script file to the public directory. This approach:

  • Bypasses middleware issues
  • Works with CSP nonces
  • Uses Next.js's optimized Script component
  • Supports both Pages Router and App Router

Important: Make sure to exclude .js files from your middleware matcher to prevent interference with static assets.