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

@dungeon-hub/api-client

v0.7.6

Published

Angular client for the Dungeon Hub API

Readme

@dungeon-hub/api-client

TypeScript/Angular client for the Dungeon Hub API. Auto-generated from OpenAPI specification.

Installation

From npm (production)

npm install @dungeon-hub/api-client

Local development (npm link)

# In api-client directory
npm run generate
npm run build
npm run link

# In your Angular app directory
npm link @dungeon-hub/api-client

Quick Start

1. Configure the API

import { ApplicationConfig } from '@angular/core';
import { provideHttpClient } from '@angular/common/http';
import { provideApi } from '@dungeon-hub/api-client';

export const appConfig: ApplicationConfig = {
  providers: [
    provideHttpClient(),
    provideApi({
      basePath: 'https://api.dungeon-hub.net'
    })
  ]
};

2. Use the services

import { Component, inject, OnInit } from '@angular/core';
import { CommonModule } from '@angular/common';
import { TicketPanelControllerService, TicketPanelModel } from '@dungeon-hub/api-client';

@Component({
  selector: 'app-ticket-panel',
  standalone: true,
  imports: [CommonModule],
  template: `
    <div *ngIf="panel">
      <h2>{{ panel.displayName || panel.name }}</h2>
      <p>ID: {{ panel.id }}</p>
    </div>
  `
})
export class TicketPanelComponent implements OnInit {
  private ticketPanelService = inject(TicketPanelControllerService);
  panel?: TicketPanelModel;

  ngOnInit() {
    this.ticketPanelService.getById1("123456789", "1").subscribe({
      next: (panel) => this.panel = panel,
      error: (err) => console.error('Failed to load panel', err)
    });
  }
}

Authentication

Configure Bearer token authentication:

import { HttpInterceptorFn } from '@angular/common/http';

export const authInterceptor: HttpInterceptorFn = (req, next) => {
  const token = localStorage.getItem('access_token');
  
  if (token) {
    req = req.clone({
      setHeaders: { Authorization: `Bearer ${token}` }
    });
  }
  
  return next(req);
};

// In app.config.ts
export const appConfig: ApplicationConfig = {
  providers: [
    provideHttpClient(withInterceptors([authInterceptor])),
    // ... rest of config
  ]
};

Important Notes

Discord Snowflake IDs

All Discord IDs (server IDs, user IDs, etc.) are represented as strings in TypeScript to prevent precision loss. JavaScript's number type cannot safely represent 64-bit integers.

// ✅ Correct
const serverId: string = "1023684107877761200";

// ❌ Wrong - will lose precision
const serverId: number = 1023684107877761200;

Models

All DTOs are available as TypeScript interfaces in the model directory:

import {
  TicketPanelModel,
  TicketPanelCreationModel,
  TicketPanelUpdateModel,
  CntRequestModel,
  DiscordServerModel,
  // ... etc
} from '@dungeon-hub/api-client';

Development

Local Development with npm link

# In dungeon-hub-api/typescript-client
npm link

# In your Angular project
npm link @dungeon-hub/api-client

Changes to the client are immediately available in your project.

Regenerating the Client

When the API changes, regenerate the client:

# Ensure Spring Boot server is running on http://localhost:8080
npm run generate

# Or from a different API URL
API_URL=https://api.dungeon-hub.net npm run generate

Configuration Options

The Configuration class accepts these options:

new Configuration({
  basePath: 'https://api.dungeon-hub.net',  // API base URL
  apiKeys: { /* API key auth if needed */ },
  accessToken: 'token',                      // Bearer token (or function)
  withCredentials: true,                     // Include cookies
})

For dynamic token handling, use an interceptor (see Authentication section above).

Support

License

GPL-3.0 - See LICENSE for details.

Related Projects