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

sjursen-digital-watchtower

v1.0.2

Published

A TypeScript Node.js SDK for Watchtower, an Intelligence as a Service (IaaS) platform that uses Google's Gemini AI model to transform traditional logging into an active intelligence system with predictive analytics and automated decision-making capabiliti

Readme

Watchtower Node.js SDK

A TypeScript Node.js SDK for interacting with Watchtower, an Intelligence as a Service (IaaS) platform that transforms traditional logging into an active intelligence system. Watchtower leverages Google's Gemini AI model to provide intelligent insights, predictive analytics, and automated decision-making capabilities.

Features

  • AI-Powered Intelligence

    • Real-time log analysis using Google's Gemini AI model
    • Pattern detection and anomaly identification
    • Predictive analytics and trend forecasting
    • Automated decision-making based on log data
  • Comprehensive Logging

    • Structured log collection and storage
    • Multi-tenant support
    • Flexible log querying and filtering
    • Context-aware logging with metadata support
  • Advanced Analytics

    • Real-time metrics and monitoring
    • Historical data analysis
    • Custom metric aggregation
    • Performance trend analysis
  • Intelligent Decision Making

    • AI-driven recommendations
    • Automated response suggestions
    • Risk assessment and prioritization
    • Actionable insights generation
  • Developer Experience

    • Full TypeScript support with comprehensive type definitions
    • Built-in error handling with custom error types
    • Simple and intuitive API
    • Complete coverage of Watchtower API endpoints

Installation

npm install sjursen-digital-watchtower

Quick Start

import { WatchtowerSDK } from 'sjursen-digital-watchtower';

// Initialize the SDK with your API base URL
const sdk = new WatchtowerSDK('YOUR_API_BASE_URL');

// Create a new log entry
await sdk.logs.createLog({
  organization_apikey: 'YOUR_ORG_API_KEY',
  app_apikey: 'YOUR_APP_API_KEY',
  item_id: 'item123',
  timestamp: new Date().toISOString(),
  level: 'info',
  message: 'User logged in',
  context: { userId: 'user456' }
});

// Get AI-powered analysis for an item
const analysis = await sdk.analyze.getLatest({
  organization_apikey: 'YOUR_ORG_API_KEY',
  app_apikey: 'YOUR_APP_API_KEY',
  item_id: 'item123'
});

// Get AI predictions for potential issues
const prediction = await sdk.intelligence.predict({
  organization_apikey: 'YOUR_ORG_API_KEY',
  app_apikey: 'YOUR_APP_API_KEY',
  item_id: 'item123',
  prediction_type: 'anomaly',
  timeframe: '24h'
});

// Get AI-driven decision recommendations
const decision = await sdk.intelligence.decide({
  organization_apikey: 'YOUR_ORG_API_KEY',
  app_apikey: 'YOUR_APP_API_KEY',
  log_data: {
    metrics: [{ name: 'cpu_usage', value: 90 }],
    context: 'high_load',
    item_name: 'server1'
  },
  allowed_actions: { restart: 'Restart the server' }
});

Documentation

For detailed documentation, please visit our documentation page.

Error Handling

The SDK provides custom error types for better error handling:

import { InvalidRequestError, AuthenticationError, ServerError } from 'sjursen-digital-watchtower/errors';

try {
  // SDK call
} catch (error) {
  if (error instanceof InvalidRequestError) {
    console.error('Invalid Request:', error.message);
  } else if (error instanceof AuthenticationError) {
    console.error('Authentication Failed:', error.message);
  } else if (error instanceof ServerError) {
    console.error('Server Error:', error.message);
  }
}

Development

# Install dependencies
npm install

# Build the project
npm run build

# Run tests
npm test

# Run linter
npm run lint

License

MIT © Sjursen Digital