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

devigo

v0.1.6

Published

Official JavaScript SDK for Devigo Studio. The whitelabel headless CMS built for every site.

Readme

Devigo JavaScript SDK

Official JavaScript SDK for the Devigo CMS. TypeScript-first, zero dependencies, ESM only.

Installation

npm install devigo

Requires Node.js 18 or later (uses the native fetch API).

Quick Start

import { createClient } from 'devigo'

const devigo = createClient({
  token: 'your-api-token',
  baseUrl: 'https://your-site.com',
})

// Fetch a page
const home = await devigo.pages.get('home')

// Fetch a post type collection
const posts = await devigo.posts('blog').list({ limit: 10 })

// Fetch a menu
const header = await devigo.menus.get('header')

API Reference

createClient(config)

Creates a new Devigo client instance.

| Parameter | Type | Description | |-----------|------|-------------| | config.token | string | Your Devigo API token (required) | | config.baseUrl | string | Your site's base URL, e.g. https://your-site.com (required) |

Returns a DevigoClient instance.


Pages

devigo.pages.list(): Promise<Page[]>

Fetch all pages.

devigo.pages.get(slug: string): Promise<Page>

Fetch a single page by slug.


Posts

devigo.posts(type: string): PostsResource

Returns a resource scoped to the given post type slug.

devigo.posts(type).list(params?): Promise<PostCollection>

Fetch a paginated list of post entries.

| Parameter | Type | Default | Description | |-----------|------|---------|-------------| | params.limit | number | — | Max entries to return | | params.offset | number | — | Number of entries to skip |

devigo.posts(type).get(slug: string): Promise<PostEntry>

Fetch a single post entry by slug.


Menus

devigo.menus.list(): Promise<MenuSummary[]>

Fetch all menus (slug and name only).

devigo.menus.get(slug: string): Promise<Menu>

Fetch a single menu with its full item tree.


Media

devigo.media.list(): Promise<MediaFile[]>

Fetch all media files.


Forms

devigo.forms.get(id: number): Promise<Form>

Fetch a form's field definitions.

devigo.forms.submit(id: number, payload: FormSubmitPayload): Promise<FormSubmitResponse>

Submit a form entry.

await devigo.forms.submit(1, {
  name: 'Jane Doe',
  email: '[email protected]',
  message: 'Hello!',
})

Error Handling

The SDK throws typed errors for common API failures:

import { createClient, DevigoNotFoundError, DevigoAuthError } from 'devigo'

try {
  const page = await devigo.pages.get('missing-page')
} catch (err) {
  if (err instanceof DevigoNotFoundError) {
    // 404 — page not found
  }
  if (err instanceof DevigoAuthError) {
    // 401/403 — invalid or expired token
  }
}

| Error Class | Status | Description | |-------------|--------|-------------| | DevigoApiError | any | Base error class for all API errors | | DevigoNotFoundError | 404 | Resource not found | | DevigoAuthError | 401/403 | Authentication or authorization failure |

License

UNLICENSED