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

@owllayer/browser

v0.4.0

Published

OwlLayer AI Browser SDK - Universal SDK for non-framework web apps

Readme

@owllayer/browser

npm version npm downloads License: MIT TypeScript strict

Universal Vanilla JavaScript SDK for OwlLayer AI. Designed for non-framework web applications (HTML, Laravel Blade, Shopify Liquid, WordPress, PHP, Ruby on Rails, Django).


Features

  • No Framework Required: Works with vanilla HTML5, legacy stacks, and template engines.
  • HTML Auto-Discovery: Declare AI tools directly in HTML markup using data-owllayer-* attributes.
  • Dual Distribution: Available as standard npm/ESM package and standalone self-hosted/CDN bundle.
  • Interactive Assistant Widget: Floating chat and voice widget rendered in isolated Shadow DOM.
  • Human-in-the-Loop (HITL): Built-in confirmation dialogs for high-risk tools.
  • Session Persistence: Automatic localStorage session caching across page navigations.

Installation

Via NPM / PNPM / Yarn

# pnpm
pnpm add @owllayer/browser @owllayer/core

# npm
npm install @owllayer/browser @owllayer/core

# yarn
yarn add @owllayer/browser @owllayer/core

Via CDN (Script Tag)

<script src="https://cdn.jsdelivr.net/npm/@owllayer/browser@latest/dist/owllayer.min.js"></script>

Quick Start

1. JavaScript Initialization (ESM)

import { OwlLayer } from '@owllayer/browser';

await OwlLayer.init({
  apiKey: 'pk_dev_123',
  endpoint: 'ws://localhost:3001/owllayer',
  widget: {
    enabled: true,
    agentName: 'Léa',
    agentTitle: 'Assistant',
  },
  hitl: { enabled: true },
  autoDiscovery: { enabled: true },
  sessionPersistence: { enabled: true, ttlMs: 1800000 },
});

// Imperative tool registration
OwlLayer.registerTool('highlight_section', {
  description: 'Highlight a section of the page',
  risk: 'none',
  handler: ({ selector }) => {
    const el = document.querySelector(String(selector));
    if (el) (el as HTMLElement).style.outline = '2px solid #22c55e';
    return { ok: true };
  },
});

2. CDN Usage (Vanilla HTML)

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>My Web App</title>
</head>
<body>
  <h1>Welcome to our store</h1>

  <button
    data-owllayer-tool="open_contact_form"
    data-owllayer-description="Open the contact form modal"
    data-owllayer-risk="none"
    data-owllayer-action="click"
    data-owllayer-selector="#contact-button"
  >
    Contact Us
  </button>

  <script src="https://cdn.jsdelivr.net/npm/@owllayer/browser@latest/dist/owllayer.min.js"></script>
  <script>
    document.addEventListener('DOMContentLoaded', async function () {
      await OwlLayer.init({
        apiKey: 'pk_live_xxxx',
        endpoint: 'wss://[CLOUD_URL]/owllayer',
        widget: { enabled: true },
      });
    });
  </script>
</body>
</html>

HTML Auto-Discovery Attributes

When autoDiscovery: { enabled: true } is set, OwlLayer scans the DOM for elements with data-owllayer-* attributes and exposes them automatically to the AI agent:

| Attribute | Required | Description | |---|---|---| | data-owllayer-tool | Yes | Unique tool name (e.g. scroll_to_pricing). | | data-owllayer-description | Yes | Description explaining what the action does to the AI. | | data-owllayer-risk | No | Risk level: none, low, medium, high, critical (default: none). | | data-owllayer-action | No | Automated action type: click, focus, scrollIntoView, setValue. | | data-owllayer-selector | No | Target CSS selector (defaults to current element). |


Public API Reference

  • OwlLayer.init(config): Initialize the connection, widget, and auto-discovery.
  • OwlLayer.registerTool(name, definition): Dynamically register an imperative tool.
  • OwlLayer.unregisterTool(name): Remove an imperative tool.
  • OwlLayer.updateContext(data): Update shadow context data sent to the AI.
  • OwlLayer.sendText(text): Send a prompt or text message to the AI agent.
  • OwlLayer.destroy(): Disconnect client, remove event listeners, and clean up the widget.

License

MIT © OwlLayer