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

tickety-api

v2.0.2

Published

A wrapper for tickety's post api, now with v3 !

Readme

Tickety Api 🎫

A wrapper for Tickety's POST api.

Installation ➕

Install this project with npm, pnpm or yarn

  npm install tickety-api
  // or
  pnpm add tickety-api
  // or 
  yarn add tickety-api

Features 🚀

  • 🎧 Listener using express
  • 🪶 Type definition
  • ➕ Supports ESM and CJS
  • 🧬 Adapters for existing web servers

Documentation ❓

import { TicketyClient } from "tickety"
// or
const { TicketyClient } = require("tickety")

// Configuration options:
// - key: Your API key (required)
// - port: Port to listen on (default: 3000)
// - route: Custom route for the webhook endpoint (default: "tickety")
const tickety = new TicketyClient({ 
  port: 3000,  // Optional, default is 3000
  key: "YOUR_API_KEY", // Required
  route: "tickety" // Optional, default is "tickety"
})

// Listen to an event
tickety.once("ready", (ready) => { // On ready !
    console.log(`Listening on port ${ready.port} and on "http://localhost:${ready.port}/tickety"`)
})

// "ticket.create" can be other events like
tickety.on("ticket.create", (create) => { // When a ticket is created
    console.log(create)
})

// -- Other Events:
// Client / System
"ready"

// Ticket Events
"ticket.create"
"ticket.close"
"ticket.rename"
"ticket.priority"
"ticket.move"
"ticket.transfer"
"ticket.claim"
"ticket.unclaim"
"ticket.add"
"ticket.remove"

// Application Events
"application.submit"
"application.accept"
"application.deny"

// Verification Events
"verification.pass"
"verification.fail"
// --

tickety.listen() // Let's listen to the port plus /tickety
// This means that the full api will be
// localhost:3000/tickety

Using with Existing Web Servers 🔌

Tickety now supports integration with existing web servers via adapters!

import express from 'express';
import { TicketyClient } from 'tickety-api';

const app = express();
app.use(express.json());

const tickety = new TicketyClient({
  key: 'your-api-key',
});

// Register the handler on your existing Express app
app.post('/webhook/tickety', tickety.createExpressHandler());

// Listen for events
tickety.on('create', (ticket) => {
  console.log('Ticket created:', ticket);
});

// Your existing app.listen() call
app.listen(8080);
import Fastify from 'fastify';
import { TicketyClient } from 'tickety-api';

const fastify = Fastify();
const tickety = new TicketyClient({
  key: 'your-api-key',
});

// Create a reusable handler
const handler = tickety.createHandler();

// Register with Fastify
fastify.post('/webhook/tickety', (request, reply) => {
  const response = handler({
    body: request.body,
    headers: request.headers
  });
  
  return reply.status(response.status).send(response.payload);
});

// Listen for events
tickety.on('ticket.create', (ticket) => {
  console.log('New ticket created:', ticket);
});

// Start your Fastify server
fastify.listen({ port: 8080 });
import { Hono } from 'hono';
import { TicketyClient } from 'tickety-api';

const app = new Hono();
const tickety = new TicketyClient({
  key: 'your-api-key',
});

// Create a reusable handler
const handler = tickety.createHandler();

// Register with Hono
app.post('/webhook/tickety', async (c) => {
  const body = await c.req.json();
  const response = handler({
    body,
    headers: Object.fromEntries(c.req.headers)
  });
  
  return c.json(response.payload, response.status);
});

// Listen for events
tickety.on('ticket.create', (ticket) => {
  console.log('Ticket created:', ticket);
});

// Export for edge deployment
export default app;
import http from 'node:http';
import { TicketyClient } from 'tickety-api';

const tickety = new TicketyClient({
  key: 'your-api-key',
});

// Create a reusable handler
const handler = tickety.createHandler();

// Create a native HTTP server
const server = http.createServer(async (req, res) => {
  if (req.method === 'POST' && req.url === '/webhook/tickety') {
    // Parse the body manually for native HTTP
    const chunks = [];
    for await (const chunk of req) {
      chunks.push(chunk);
    }
    
    const body = JSON.parse(Buffer.concat(chunks).toString());
    
    const response = handler({
      body,
      headers: req.headers
    });
    
    res.statusCode = response.status;
    res.setHeader('Content-Type', 'application/json');
    res.end(JSON.stringify(response.payload));
  } else {
    // Handle other routes
  }
});

// Listen for events
tickety.on('ticket.create', (ticket) => {
  console.log('New ticket:', ticket);
});

server.listen(8080);

Adapter API Reference

The adapter API consists of three main methods:

Core method that handles Tickety webhook requests.

interface RequestOptions {
  body: any; // The request body
  headers: Record<string, string>; // Request headers
}

interface RequestResponse {
  status: number; // HTTP status code
  payload: Record<string, any>; // Response payload
}

// Usage
const response = tickety.handleRequest({ 
  body: requestBody,
  headers: requestHeaders 
});

Creates a handler function specifically for Express.

// Returns a function with signature (req, res) => { ... }
const handler = tickety.createExpressHandler();

// Use with Express
app.post('/webhook/tickety', handler);

Creates a generic handler function.

// Returns a function that accepts { body, headers } and returns { status, payload }
const handler = tickety.createHandler();

// Use with any framework
const response = handler({
  body: requestBody,
  headers: requestHeaders
});

Authors