Skip to content

FlyWeb — Make the internet machine-readable. Core types + Next.js integration.

Notifications You must be signed in to change notification settings

flywebprotocol/flyweb

Repository files navigation

FlyWeb

SEO for the AI era. Make your website visible, readable, and cited by every AI agent.

npm FlyWeb enabled

An open protocol that lets every website describe its content in a structured way machines can understand. One file. Universal discovery. Enforced attribution.

robots.txt tells machines where not to go. flyweb.json tells them what you have — and how to credit you.

How It Works

Every website publishes /.well-known/flyweb.json:

{
  "flyweb": "1.0",
  "entity": "TechCrunch",
  "type": "news",
  "attribution": {
    "required": true,
    "license": "CC-BY-4.0",
    "must_link": true
  },
  "resources": {
    "articles": {
      "path": "/.flyweb/articles",
      "format": "jsonl",
      "fields": ["title", "author", "date", "content"],
      "access": "free",
      "query": "?tag={tag}"
    }
  }
}

AI agents check this file first — no scraping, no guessing. Your content, your credit, your terms.

Packages

Package Description npm
flyweb Core types, validation, CLI, and client SDK npm
next-flyweb Next.js integration npm
astro-flyweb Astro integration npm
sveltekit-flyweb SvelteKit integration npm
nuxt-flyweb Nuxt/Vue integration npm
express-flyweb Express/Node.js middleware npm

CLI

npx flyweb check https://example.com   # check any website
npx flyweb check ./flyweb.json         # validate local file
npx flyweb discover https://example.com # discover & fetch structured data
npx flyweb init                         # generate starter config

Client SDK

For AI agents and developers consuming FlyWeb-enabled sites:

import { discover, fetchResource } from 'flyweb/client';

const site = await discover('https://example.com');
console.log(site.config.entity); // "TechCrunch"

const articles = await fetchResource(
  'https://example.com',
  site.config.resources.articles,
  { params: { tag: 'ai' }, limit: 10 }
);

Quick Start

Next.js:

npm install next-flyweb
// app/.well-known/flyweb.json/route.ts
import { createHandler } from 'next-flyweb';

export const GET = createHandler({
  flyweb: '1.0',
  entity: 'My Blog',
  type: 'blog',
  attribution: { required: true, license: 'CC-BY-4.0', must_link: true },
  resources: {
    posts: {
      path: '/.flyweb/posts',
      format: 'jsonl',
      fields: ['title', 'author', 'date', 'content'],
      access: 'free',
    },
  },
});

SvelteKit:

npm install sveltekit-flyweb
// src/routes/.well-known/flyweb.json/+server.ts
import { createHandler } from 'sveltekit-flyweb';

export const GET = createHandler({
  flyweb: '1.0',
  entity: 'My Blog',
  type: 'blog',
  resources: { posts: { path: '/.flyweb/posts', format: 'jsonl', fields: ['title', 'content'] } },
});

Express:

npm install express-flyweb
import express from 'express';
import { flyweb } from 'express-flyweb';

const app = express();
app.use(flyweb({
  flyweb: '1.0',
  entity: 'My API',
  type: 'api',
  resources: { items: { path: '/.flyweb/items', format: 'json', fields: ['id', 'name'] } },
}));

Astro / Nuxt / Any site:

npm install astro-flyweb    # Astro
npm install nuxt-flyweb     # Nuxt
npx flyweb init              # Any site — generates flyweb.json

Badge

Add to your README to show your site supports FlyWeb:

[![FlyWeb enabled](https://raw.githubusercontent.com/flywebprotocol/flyweb/master/badge.svg)](https://flyweb.io)

The Three Layers

  1. Discovery/.well-known/flyweb.json tells machines what data you have
  2. Structure — Resources served as clean JSON/JSONL, not HTML
  3. Query — Standard URL params for filtering: ?tag=ai&limit=10

Attribution

FlyWeb enforces attribution at the protocol level. Even on the free tier, AI agents must credit the source:

"attribution": {
  "required": true,
  "format": "Source: {entity} — {url}",
  "license": "CC-BY-4.0",
  "must_link": true
}

You can set price to zero. You can never set attribution to zero.

Spec

Read the full protocol specification: SPEC.md

Framework RFCs

We've proposed native FlyWeb support in major frameworks:

Links

License

MIT

About

FlyWeb — Make the internet machine-readable. Core types + Next.js integration.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •