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

@olo/fraud-prevention-js-sdk

v1.0.0

Published

[![npm version](https://img.shields.io/npm/v/@olo/fraud-prevention-js-sdk.svg)](https://www.npmjs.com/package/@olo/fraud-prevention-js-sdk) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Readme

Fraud Prevention JS SDK

npm version License: MIT

Introduction

The Fraud Prevention JS SDK is a lightweight, browser-based JavaScript library that simplifies fraud prevention integration in web applications. The SDK handles script injection, session tracking, and token management automatically, so you can protect your application from fraudulent transactions with just a few lines of code.

Currently Supported Providers:

  • Forter - Real-time fraud prevention platform

Key Features:

  • Simple, minimal API - just initialize, create, and get the token
  • TypeScript support with full type definitions
  • Automatic session tracking and token generation
  • Memory leak prevention with built-in cleanup

Installation

npm install @olo/fraud-prevention-js-sdk

Quick Start

import { ForterFP, ForterEnvironment } from "@olo/fraud-prevention-js-sdk";

// 1. Initialize once at app startup
const fraudPrevention = new ForterFP({
	siteId: "olo-forter-site-id", // Contact your Olo representative to obtain this
	environment: ForterEnvironment.Production,
});

fraudPrevention.create();

// 2. Make it globally accessible
window.fraudPrevention = fraudPrevention;

// 3. Use throughout your app when submitting orders
await fetch("/api/orders", {
	method: "POST",
	body: JSON.stringify({
		...orderData,
		fraudSessionId: window.fraudPrevention?.getFraudSessionId() ?? undefined,
	}),
});

Note: The siteId is Olo's global Forter site ID. Contact your Olo representative to obtain this value.

Provider Documentation

For detailed integration instructions and API reference, see:

API Reference

Core Classes

ForterFP

The Forter fraud prevention integration class.

Constructor:

new ForterFP(config: ForterFPConfig)

Configuration:

  • siteId (string, required): Olo's global Forter site ID. Contact your Olo representative to obtain this value.
  • environment (ForterEnvironment, optional): Environment setting (Production, Staging, or Development)

Methods:

  • create(): Initializes and injects the Forter script into the DOM
  • getFraudSessionId(): Returns the fraud session ID (token) or null if not yet available
  • destroy(removeScript?: boolean): Cleans up event listeners and optionally removes the script from the DOM

For complete API documentation and usage examples, refer to the Forter Integration Guide.

Development

See CONTRIBUTING.md for development setup and contribution guidelines.

Quick Start for Contributors

# Install dependencies
npm install

# Run tests
npm run test

# Build the library
npm run build

# Run linting
npm run lint

Browser Support

This library supports all modern browsers that support ES2022.

License

MIT © Olo

Resources