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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@medianova/sdk

v1.1.50

Published

The Bot Management SDK provides bot detection and analytics functionality for web applications running in browsers. This SDK helps protect your application from malicious bots, collect analytics data, and enhance overall security.

Downloads

374

Readme

Bot Management SDK

The Bot Management SDK provides bot detection and analytics functionality for web applications running in browsers. This SDK helps protect your application from malicious bots, collect analytics data, and enhance overall security.

Table of Contents

Installation

Using NPM (TypeScript/JavaScript)

To install the SDK in your project using npm, run the following command:

npm install @medianova/sdk

Using CDN (HTML)

Add the following script tag to the <head> section of your HTML file:

<script src="https://botmanagement.mncdn.com/botmanagement-latest.js" type="module" defer></script>

Usage

TypeScript/JavaScript

To initialize and run the SDK in a TypeScript or JavaScript environment, follow these steps:

import { init } from '@medianova/sdk';

async function runSDK() {
const clientKey = "your-client-key-here";
const monitoringMode = false; // If you set the variable as true, the SDK will only collect the visit data but not apply the bot prevention.
try {
await init(clientKey, { monitoringMode });
console.log('Medianova Client SDK initialized successfully.');
} catch (error) {
console.error('SDK initialization or operation failed:', error);
}
}

runSDK();

Notes:

  • Replace "your-client-key-here" with the client key provided to you by Medianova.
  • Setting monitoringMode to true the SDK will only collect the visit data but not apply the bot prevention.

HTML

To use the SDK directly in an HTML file, add the following script tags to your <head> and <body> sections:

In the <head> section:

<script src="https://botmanagement.mncdn.com/botmanagement-latest.js" type="module" defer></script>

In the <body> section:


<script type="module">
  import { init } from 'https://botmanagement.mncdn.com/botmanagement-latest.js';

  async function runSDK() {
    const clientKey = "your-client-key-here";
    const monitoringMode = false; // Set to true if you want to use monitoring only
    try {
      await init(clientKey, { monitoringMode });
      console.log('Medianova Client SDK initialized successfully.');
    } catch (error) {
      console.error('SDK initialization or operation failed:', error);
    }
  }

  runSDK();
</script>

Notes:

  • Replace "your-client-key-here" with the client key provided to you by Medianova.
  • Setting monitoringMode to `true the SDK will only collect the visit data but not apply the bot prevention.

Configuration Options

The init function accepts the following parameters:

  • clientKey (string): Required. Your unique client key provided by Medianova.
  • options (object): Optional. Configuration options for the SDK.
    • monitoringMode (boolean): When set to `true, the SDK runs in monitoring mode only, without applying bot mitigation.

Example:

await init('your-client-key-here', { monitoringMode: true });

Development

If you want to contribute to the SDK or run it locally, follow these steps:

Requirements

  • Deno: Ensure that Deno is installed on your machine. Visit deno docs for installation instructions.

Setup

To set up the development environment, run:

deno install

Running the SDK Locally

Start a local server using the following command:

deno task serve

Test

# this will be needed to initialize a page with the SDK running within.
deno task test

# then, to check if the splash image appears, run the command below:
deno task test:bot

# to simulate the visit as a normal visit, run the command below:
deno task test:human

Support

If you encounter any issues or have questions, please reach out to our support team at [email protected].

License

This repository is licensed under the MIT License. Please see the LICENSE file for more information.