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

next-flyweb

v0.1.0

Published

FlyWeb integration for Next.js — serve structured data to AI agents with zero effort.

Readme

next-flyweb

FlyWeb integration for Next.js — serve structured data to AI agents with zero effort.

Install

npm install next-flyweb

Quick Start

1. Serve your flyweb.json

Create a route handler at app/.well-known/flyweb.json/route.ts:

import { createHandler } from 'next-flyweb';

export const GET = createHandler({
  flyweb: '1.0',
  entity: 'My Blog',
  type: 'blog',
  url: 'https://myblog.com',
  resources: {
    posts: {
      path: '/.flyweb/posts',
      format: 'jsonl',
      fields: ['title', 'author', 'date', 'summary', 'content', 'tags'],
      query: '?tag={tag}&limit={n}',
    },
  },
});

That's it. Every AI agent on earth can now discover your content at https://myblog.com/.well-known/flyweb.json.

2. Serve your data

Create a resource handler at app/.flyweb/posts/route.ts:

import { createResourceHandler } from 'next-flyweb';
import { getAllPosts } from '@/lib/posts';

export const GET = createResourceHandler({
  format: 'jsonl',
  source: getAllPosts,
  queryable: ['tag', 'author'],
  maxLimit: 50,
});

Now AI agents can query your posts:

GET /.flyweb/posts              → all posts (JSONL)
GET /.flyweb/posts?tag=ai       → filtered by tag
GET /.flyweb/posts?limit=10     → first 10 posts
GET /.flyweb/posts?offset=10    → skip first 10

API

createHandler(config)

Creates a GET handler that serves your flyweb.json. Validates the config at build time and returns a properly cached JSON response with CORS headers.

Parameters:

  • config: FlyWebConfig — your FlyWeb configuration

createResourceHandler(options)

Creates a GET handler that serves structured data with filtering and pagination.

Options:

| Option | Type | Description | |--------|------|-------------| | format | 'json' \| 'jsonl' | Response format | | source | () => T[] \| Promise<T[]> | Function that returns your data | | queryable | string[] | Fields that can be filtered via query params | | maxLimit | number | Max items per request (default: 100) |

Re-exports

next-flyweb re-exports everything from flyweb for convenience:

import { defineConfig, validate } from 'next-flyweb';
import type { FlyWebConfig, FlyWebResource } from 'next-flyweb';

Full Example

app/
├── .well-known/
│   └── flyweb.json/
│       └── route.ts          ← createHandler()
├── .flyweb/
│   ├── posts/
│   │   └── route.ts          ← createResourceHandler()
│   └── authors/
│       └── route.ts          ← createResourceHandler()
└── page.tsx

Links

License

MIT