flyweb
v0.3.0
Published
FlyWeb protocol — make the internet machine-readable. Core types, validation, and helpers.
Maintainers
Readme
flyweb
Core types, validation, and helpers for the FlyWeb protocol — an open standard that makes the internet machine-readable.
robots.txttells machines where not to go.flyweb.jsontells them what you have.
Install
npm install flywebUsage
Define a config
import { defineConfig } from 'flyweb';
export default defineConfig({
flyweb: '1.0',
entity: 'TechCrunch',
type: 'news',
resources: {
articles: {
path: '/.flyweb/articles',
format: 'jsonl',
fields: ['title', 'author', 'date', 'summary', 'content', 'tags'],
query: '?tag={tag}&limit={n}',
},
authors: {
path: '/.flyweb/authors',
format: 'json',
fields: ['name', 'bio', 'avatar'],
},
},
});Validate a config
import { validate } from 'flyweb';
const result = validate(someObject);
if (!result.valid) {
console.error(result.errors);
// ["resources.posts.path: must start with \"/\"",
// "resources.posts.format: must be one of json, jsonl, csv, xml"]
}The Protocol
Every website publishes a file at /.well-known/flyweb.json that describes its structured data:
{
"flyweb": "1.0",
"entity": "TechCrunch",
"type": "news",
"resources": {
"articles": {
"path": "/.flyweb/articles",
"format": "jsonl",
"fields": ["title", "author", "date", "content"],
"query": "?tag={tag}"
}
}
}AI agents check this file first. No scraping. No guessing. Just structured data.
Types
import type { FlyWebConfig, FlyWebResource, EntityType, ResourceFormat } from 'flyweb';| Type | Description |
|------|-------------|
| FlyWebConfig | Root config object served at /.well-known/flyweb.json |
| FlyWebResource | A single resource (path, format, fields, query) |
| EntityType | 'news' \| 'blog' \| 'ecommerce' \| 'saas' \| 'docs' \| ... |
| ResourceFormat | 'json' \| 'jsonl' \| 'csv' \| 'xml' |
Framework Integrations
- Next.js —
next-flyweb
Links
License
MIT
