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

@hublab/sdk

v1.1.0

Published

Official TypeScript SDK for HubLab API - Build production-ready web apps with 8,144+ AI-powered components. Features: lazy loading (89% smaller bundle), rate limiting, caching, and structured logging.

Readme

@hublab/sdk

Official TypeScript SDK for the HubLab API.

Installation

npm install @hublab/sdk
# or
yarn add @hublab/sdk
# or
pnpm add @hublab/sdk

Quick Start

import { HubLab } from '@hublab/sdk'

const hublab = new HubLab({
  apiKey: 'hublab_sk_your_api_key_here'
})

// Create a project
const project = await hublab.projects.create({
  name: 'My Dashboard',
  template: 'dashboard',
  theme: 'modern-blue'
})

// Add a capsule
await hublab.projects.addCapsule(project.id, {
  type: 'stats-grid',
  props: {
    columns: 4,
    stats: [
      { label: 'Users', value: '1,234', icon: 'users' },
      { label: 'Revenue', value: '$45.6k', icon: 'dollar' }
    ]
  }
})

// Export to Next.js
const exported = await hublab.projects.export(project.id, {
  format: 'nextjs',
  options: {
    typescript: true,
    includeReadme: true
  }
})

// Deploy to Vercel
const deployment = await hublab.projects.deploy(project.id, {
  platform: 'vercel',
  config: {
    envVars: {
      NEXT_PUBLIC_SUPABASE_URL: 'your-url'
    }
  }
})

console.log(`Deployed to: ${deployment.url}`)

API Reference

Client

const hublab = new HubLab({
  apiKey: string
  baseUrl?: string // default: 'https://hublab.dev/api/v1'
})

Projects

create(data)

Create a new project.

const project = await hublab.projects.create({
  name: 'My Project',
  description: 'Optional description',
  template: 'dashboard', // blank | dashboard | landing | ecommerce | admin | blog
  theme: 'modern-blue'  // or custom ThemeConfig object
})

list(params?)

List all projects with optional filtering and pagination.

const { projects, pagination } = await hublab.projects.list({
  page: 1,
  limit: 10,
  status: 'ready',
  template: 'dashboard'
})

get(projectId)

Get a single project by ID.

const project = await hublab.projects.get('project-id')

update(projectId, data)

Update a project.

const project = await hublab.projects.update('project-id', {
  name: 'Updated Name',
  theme: 'dark-purple'
})

delete(projectId)

Delete a project.

await hublab.projects.delete('project-id')

addCapsule(projectId, data)

Add a capsule to a project.

const capsule = await hublab.projects.addCapsule('project-id', {
  type: 'data-table',
  props: {
    columns: [
      { key: 'name', label: 'Name' },
      { key: 'email', label: 'Email' }
    ],
    showPagination: true
  },
  dataSource: {
    type: 'supabase',
    config: {
      table: 'users',
      fields: ['name', 'email']
    }
  }
})

listCapsules(projectId)

List all capsules in a project.

const capsules = await hublab.projects.listCapsules('project-id')

updateCapsule(projectId, capsuleId, data)

Update a capsule.

const capsule = await hublab.projects.updateCapsule(
  'project-id',
  'capsule-id',
  {
    props: { /* updated props */ }
  }
)

deleteCapsule(projectId, capsuleId)

Delete a capsule.

await hublab.projects.deleteCapsule('project-id', 'capsule-id')

addIntegration(projectId, data)

Add an integration to a project.

const integration = await hublab.projects.addIntegration('project-id', {
  type: 'supabase',
  config: {}
})

listIntegrations(projectId)

List all integrations in a project.

const integrations = await hublab.projects.listIntegrations('project-id')

deleteIntegration(projectId, integrationType)

Delete an integration.

await hublab.projects.deleteIntegration('project-id', 'supabase')

export(projectId, data)

Export a project to code.

const { files } = await hublab.projects.export('project-id', {
  format: 'nextjs', // nextjs | react | html | vue
  options: {
    typescript: true,
    includeReadme: true,
    includeEnvExample: true
  }
})

deploy(projectId, data)

Deploy a project to a hosting platform.

const deployment = await hublab.projects.deploy('project-id', {
  platform: 'vercel', // vercel | netlify | cloudflare
  config: {
    domain: 'my-app.example.com',
    envVars: {
      NEXT_PUBLIC_API_URL: 'https://api.example.com'
    }
  }
})

preview(projectId)

Generate a preview URL for a project.

const { previewUrl, expiresAt } = await hublab.projects.preview('project-id')

Themes

list()

List all available preset themes.

const themes = await hublab.themes.list()

get(themeId)

Get a specific theme.

const theme = await hublab.themes.get('modern-blue')

Catalog

listCapsules(params?)

Browse available capsule types.

const capsules = await hublab.catalog.listCapsules({
  category: 'charts',
  search: 'bar'
})

getCapsule(capsuleType)

Get details for a specific capsule type.

const capsule = await hublab.catalog.getCapsule('data-table')

Error Handling

import { HubLabError } from '@hublab/sdk'

try {
  const project = await hublab.projects.create({ name: 'Test' })
} catch (error) {
  if (error instanceof HubLabError) {
    console.error('Error code:', error.code)
    console.error('Error message:', error.message)
    console.error('HTTP status:', error.status)
    console.error('Details:', error.details)
  }
}

Types

All types are exported from the SDK:

import type {
  Project,
  Capsule,
  ThemeConfig,
  CreateProjectRequest,
  ExportRequest,
  DeployRequest,
  // ... and more
} from '@hublab/sdk'

Examples

Complete Workflow

import { HubLab } from '@hublab/sdk'

const hublab = new HubLab({ apiKey: process.env.HUBLAB_API_KEY })

async function buildAndDeployApp() {
  // 1. Create project
  const project = await hublab.projects.create({
    name: 'User Dashboard',
    template: 'dashboard',
    theme: 'dark-purple'
  })

  // 2. Add stats grid
  await hublab.projects.addCapsule(project.id, {
    type: 'stats-grid',
    props: {
      columns: 4,
      stats: [
        { label: 'Active Users', value: '2,543', icon: 'users' },
        { label: 'Total Revenue', value: '$124.5k', icon: 'dollar' },
        { label: 'Projects', value: '89', icon: 'folder' },
        { label: 'Completion', value: '94%', icon: 'check' }
      ]
    }
  })

  // 3. Add data table with live data
  await hublab.projects.addCapsule(project.id, {
    type: 'data-table',
    props: {
      columns: [
        { key: 'name', label: 'User' },
        { key: 'email', label: 'Email' },
        { key: 'status', label: 'Status' },
        { key: 'created_at', label: 'Joined' }
      ],
      showPagination: true,
      showSearch: true
    },
    dataSource: {
      type: 'supabase',
      config: {
        table: 'users',
        fields: ['name', 'email', 'status', 'created_at'],
        orderBy: { column: 'created_at', ascending: false },
        limit: 50
      }
    }
  })

  // 4. Add Supabase integration
  await hublab.projects.addIntegration(project.id, {
    type: 'supabase',
    config: {}
  })

  // 5. Export to Next.js
  const exported = await hublab.projects.export(project.id, {
    format: 'nextjs',
    options: {
      typescript: true,
      includeReadme: true,
      includeEnvExample: true
    }
  })

  console.log(`Generated ${exported.files.length} files`)

  // 6. Deploy to Vercel
  const deployment = await hublab.projects.deploy(project.id, {
    platform: 'vercel',
    config: {
      envVars: {
        NEXT_PUBLIC_SUPABASE_URL: process.env.SUPABASE_URL,
        NEXT_PUBLIC_SUPABASE_ANON_KEY: process.env.SUPABASE_ANON_KEY
      }
    }
  })

  console.log(`Deployed to: ${deployment.url}`)
  return deployment.url
}

buildAndDeployApp()

License

MIT

Support

  • Documentation: https://hublab.dev/api-docs
  • GitHub: https://github.com/hublab/sdk-typescript
  • Email: [email protected]