← Public packages
@hypercubed/web-search
Unified web search - Brave via BraveSearch secret (api.search.brave.com), then DDG Instant, then Wikipedia. Normalized {provider, results} shape.
README.md
26 lines · 1.2 KB · Markdownweb-search
Intent
Unified web search for any Kody agent. Tries Brave Search first, then free Worker-safe fallbacks. Normalized {provider, results: {title, url, snippet}[]} shape.
Setup (required for Brave)
- Create secret
BraveSearchat/account/secrets/new— paste yourBSA...key from https://api.search.brave.com/app/keys (scope: User). - In the secret, add Allowed sites:
api.search.brave.com - Add Allowed packages:
web-search(select@hypercubed/web-searchor your fork) — required even for self-authored packages when editing the secret. - Placeholder is
{{secret:BraveSearch}}(singular, perdocs/use/secrets-and-values.md), not{{secrets...}}.
Without the secret/host allowlist, the package falls back to DuckDuckGo Instant (curated) then Wikipedia (both Worker-safe but weaker than Brave).
Usage
import { search } from '@hypercubed/web-search'
const { provider, results } = await search('Block Goose AI agent', 5)Prose: "Use my web-search package to search for 'X'"
Fallback order
| Order | Provider | Cost | Quality |
|---|---|---|---|
| 1 | Brave Search | Free 2k/mo | Best (full index) |
| 2 | DuckDuckGo Instant | Free | Curated only |
| 3 | Wikipedia | Free | Encyclopedia only |