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

@teliagen/plugin-playground

v0.4.5

Published

> Interactive API playground for Teliagen applications.

Readme

@teliagen/plugin-playground

Interactive API playground for Teliagen applications.

npm version TypeScript License: MIT

Overview

@teliagen/plugin-playground provides an interactive UI for testing your Teliagen actions:

  • Action Explorer – Browse all available actions
  • Input Builder – Auto-generated forms from schemas
  • Response Viewer – Formatted JSON responses
  • Authentication – Login and test authenticated actions
  • History – Request/response history

Installation

npm install @teliagen/plugin-playground
# or
pnpm add @teliagen/plugin-playground

Quick Start

import { TeliagenApp } from '@teliagen/server';
import { PlaygroundPlugin } from '@teliagen/plugin-playground';

const app = new TeliagenApp();
await app.initialize();

const playground = PlaygroundPlugin({
  name: 'playground',
  path: '/playground'
});

await app.registerPlugins([playground]);
await app.start();

// Access playground at http://localhost:3000/playground

Configuration

interface PlaygroundPluginOptions {
  name: string;                  // Plugin instance name
  path?: string;                 // URL path (default: '/playground')
  
  // Access control
  enabled?: boolean;             // Enable/disable (default: true)
  allowInProduction?: boolean;   // Allow in prod (default: false)
  
  // Authentication
  requireAuth?: boolean;         // Require login (default: false)
  authPlugin?: string;           // Auth plugin name to use
  
  // UI customization
  title?: string;                // Page title
  logo?: string;                 // Logo URL
  theme?: 'light' | 'dark';      // UI theme
}

Examples

Basic Setup

const playground = PlaygroundPlugin({
  name: 'playground',
  path: '/api/playground',
  title: 'My API Playground'
});

Protected Playground

const playground = PlaygroundPlugin({
  name: 'playground',
  requireAuth: true,
  authPlugin: 'auth',  // Use auth plugin for login
  allowInProduction: false
});

Production Setup

const playground = PlaygroundPlugin({
  name: 'playground',
  enabled: process.env.NODE_ENV !== 'production',
  // Or allow in production with auth:
  // enabled: true,
  // allowInProduction: true,
  // requireAuth: true
});

Features

Action Explorer

Browse all registered actions organized by module and provider:

├── auth (module)
│   └── AuthActions (provider)
│       ├── login
│       ├── register
│       └── refreshToken
├── users
│   └── UserActions
│       ├── listUsers
│       ├── getUser
│       └── updateUser
└── orders
    └── OrderActions
        ├── createOrder
        └── getOrderDetails

Input Builder

Auto-generates input forms from your @Input schemas:

class CreateOrderInput {
  @String({ required: true })
  customerId!: string;

  @Array({ itemType: Object })
  items!: OrderItem[];

  @String({ optional: true })
  notes?: string;
}

Generates a form with:

  • Text input for customerId
  • Array builder for items
  • Optional text area for notes

Response Viewer

  • Syntax-highlighted JSON
  • Collapsible nested objects
  • Copy to clipboard
  • Response time and status

Authentication

If requireAuth is enabled:

  1. User logs in via auth plugin
  2. Token is stored in session
  3. All requests include auth header
  4. Test protected actions easily

Accessing Actions via Playground

GET http://localhost:3000/playground

# Interactive UI at:
http://localhost:3000/playground

The playground fetches action metadata from:

GET /teliagen/metadata

Ensure you have ClientContractSync or ServerContractSync enabled.

Security

Development Only (Default):

PlaygroundPlugin({
  name: 'playground',
  allowInProduction: false  // Disabled in production
});

Production with Auth:

PlaygroundPlugin({
  name: 'playground',
  allowInProduction: true,
  requireAuth: true,
  authPlugin: 'auth'
});

IP Whitelist (Advanced):

PlaygroundPlugin({
  name: 'playground',
  allowInProduction: true,
  middleware: async (ctx, next) => {
    const allowedIPs = ['127.0.0.1', '10.0.0.0/8'];
    if (!isAllowedIP(ctx.ip, allowedIPs)) {
      throw new Error('Access denied');
    }
    await next();
  }
});

Requirements

  • Node.js >= 18.0.0
  • @teliagen/server >= 0.1.0

Related Packages

Documentation

For full documentation, visit docs.teliagen.org.

License

MIT © Teliagen Contributors