Deploy the Worker
Run your metadata endpoint on Cloudflare.
Version 0.1.1 is available on npm. Install @linkoi/core to use the extraction library, or add @linkoi/worker for Cloudflare deployment.
Prepare the workspace#
npm init -y
npm install @linkoi/core@0.1.1 @linkoi/worker@0.1.1
npm install --save-dev wranglerCreate index.js containing export { default } from "@linkoi/worker"; and a wrangler.json file:
{
"name": "my-linkoi",
"main": "index.js",
"compatibility_date": "2026-09-24",
"compatibility_flags": ["nodejs_compat"],
"workers_dev": false,
"kv_namespaces": [{"binding": "META_CACHE", "id": "REPLACE_WITH_YOUR_KV_NAMESPACE_ID"}],
"vars": {"SELF_HOSTS": "YOUR-WORKER.YOUR-SUBDOMAIN.workers.dev"}
}Create the cache#
npx wrangler kv namespace create META_CACHEReplace REPLACE_WITH_YOUR_KV_NAMESPACE_ID in wrangler.json with the returned namespace ID. Choose your own Worker name. Keep nodejs_compat enabled.
Configure the Worker#
| Setting | Default |
|---|---|
| MAX_HTML_BYTES | 2097152 |
| FETCH_TIMEOUT_MS | 5000 |
| FRESH_TTL_SECONDS | 86400 |
| STALE_TTL_SECONDS | 604800 |
| SELF_HOSTS | Comma-separated hostnames to reject. Set this to your API hostname. |
Deploy and set secrets#
To avoid exposing an unauthenticated endpoint during setup, add "workers_dev": false to the config and leave routes unset for the first deployment.
npx wrangler deploy --config wrangler.json
npx wrangler secret put API_KEY --config wrangler.json
# Optional provider integration
npx wrangler secret put YOUTUBE_API_KEY --config wrangler.jsonAfter the secrets are configured, enable workers_dev or add your custom domain and deploy again. Add rate limits appropriate to your use case.
Verify the endpoint#
curl "https://YOUR-WORKER.YOUR-SUBDOMAIN.workers.dev/health" \
-H "Authorization: Bearer $LINKOI_API_KEY"Expect { "ok": true }. Then test an extraction using the HTTP API guide.