You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Lower-level SDK trial (@vapi-network/core + @vapi-network/sources, Linux / Node 24): discovery and the 402 quote worked — but the config's allowPrivateNetwork flag never reaches the registry source
#149
OS: Linux (x86_64, headless server, no desktop keyring)
Node: v24.22.1 · npm: 10.9.4
Packages installed: @vapi-network/core0.17.5 and @vapi-network/sources0.17.5 (the docs still say the latest release is 0.17.0)
This is a separate trial from my earlier bundled-client post: this time I followed the SDK reference's lower-level "Discover and pay" and "Manage wallets and caps" examples only.
What worked
With a standard consumer tsconfig (skipLibCheck on), the example type-checks exactly as written — every import and signature matches the docs.
After one option fix (below): source.search("weather") returned 10 results, and the free 402 probe plus parse402Response produced a complete quote — amountAtomic 10000 ($0.01), Base, USDC, and the payee address. The bundled client's call.inspect never showed me a quote like this (its first listing had payment: null).
WalletStore.create worked once VAPI_VAULT_PASSWORD was set, the example's unlock(name, "") branch for vault accounts works, and the "Manage wallets and caps" snippet is exactly right once the wallet exists — I verified perCallAtomic 50000 / perDayAtomic 1000000 ($0.05 per call, $1 per day) after running it.
The first thing that broke
The example pasted verbatim into a default npm project fails before it runs, the same wall as the bundled quickstart: top-level await is not supported with the "cjs" output format (TS1309). The lower-level section never mentions needing "type": "module" either.
What else broke or confused me
A strict type-check drowns in the package's own type errors. With tsc --strict and no skipLibCheck, @vapi-network/core's own .d.ts files error on imports of zod, viem and @solana/kit — none of which are declared as dependencies or peer dependencies (both packages declare zero dependencies). The bundled vapi-network package's types are clean; the lower-level ones are not, so any strict consumer project has to turn on skipLibCheck to use them.
A partial config file crashes loadConfig, and a complete one still does not fix search. Writing just {"allowPrivateNetwork": true} into the config made loadConfig throw a ZodError — the file is validated whole, with no merging into defaults, and nothing tells you that. Worse, with a complete config and the flag true, the verbatim example still died at search: NetworkGuardError: URL hostname "api.vapinetwork.ai" is not allowed — the registry source ignores the config flag. The fix was passing allowPrivateNetwork as an option to vapiRegistrySource itself; that option exists in the types, but the example never uses it there (it only passes the flag to createPublicFetch, later in the same snippet). On the bundled client, editing the config was enough; on this path it is not.
Every wallet dead end points at a binary these packages do not ship. Before any wallet exists, the errors say KeystoreError: No wallet yet. Run vapi init. — but installing @vapi-network/core + @vapi-network/sources gives you no vapi binary at all. The only way forward is WalletStore.create, which the "Discover and pay" example never shows. (The caps example's error is better: No wallet named agent. This machine has: main.)
The example's payTo pinning is silently a no-op for the first listing. The snippet reads listing.metadata?.payment to pin the expected payee, but the first search result's metadata.payment was undefined, so the pin quietly did nothing — exactly on the step whose job is verifying who gets paid.
Where I stopped
After reading the 402 quote. I did not run wallet.authorize, buildCompatibleX402Payment, or the paid request, and I did not fund, log in, buy, or back up anything; the sandbox wallets were never funded and nothing was signed.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Environment
@vapi-network/core0.17.5 and@vapi-network/sources0.17.5 (the docs still say the latest release is 0.17.0)What worked
skipLibCheckon), the example type-checks exactly as written — every import and signature matches the docs.source.search("weather")returned 10 results, and the free 402 probe plusparse402Responseproduced a complete quote — amountAtomic 10000 ($0.01), Base, USDC, and the payee address. The bundled client'scall.inspectnever showed me a quote like this (its first listing hadpayment: null).WalletStore.createworked onceVAPI_VAULT_PASSWORDwas set, the example'sunlock(name, "")branch for vault accounts works, and the "Manage wallets and caps" snippet is exactly right once the wallet exists — I verified perCallAtomic 50000 / perDayAtomic 1000000 ($0.05 per call, $1 per day) after running it.The first thing that broke
The example pasted verbatim into a default npm project fails before it runs, the same wall as the bundled quickstart: top-level await is not supported with the "cjs" output format (TS1309). The lower-level section never mentions needing
"type": "module"either.What else broke or confused me
tsc --strictand noskipLibCheck,@vapi-network/core's own .d.ts files error on imports ofzod,viemand@solana/kit— none of which are declared as dependencies or peer dependencies (both packages declare zero dependencies). The bundledvapi-networkpackage's types are clean; the lower-level ones are not, so any strict consumer project has to turn onskipLibCheckto use them.loadConfig, and a complete one still does not fix search. Writing just{"allowPrivateNetwork": true}into the config madeloadConfigthrow a ZodError — the file is validated whole, with no merging into defaults, and nothing tells you that. Worse, with a complete config and the flag true, the verbatim example still died at search:NetworkGuardError: URL hostname "api.vapinetwork.ai" is not allowed— the registry source ignores the config flag. The fix was passingallowPrivateNetworkas an option tovapiRegistrySourceitself; that option exists in the types, but the example never uses it there (it only passes the flag tocreatePublicFetch, later in the same snippet). On the bundled client, editing the config was enough; on this path it is not.KeystoreError: No wallet yet. Run vapi init.— but installing@vapi-network/core+@vapi-network/sourcesgives you novapibinary at all. The only way forward isWalletStore.create, which the "Discover and pay" example never shows. (The caps example's error is better:No wallet named agent. This machine has: main.)listing.metadata?.paymentto pin the expected payee, but the first search result'smetadata.paymentwasundefined, so the pin quietly did nothing — exactly on the step whose job is verifying who gets paid.Where I stopped
After reading the 402 quote. I did not run
wallet.authorize,buildCompatibleX402Payment, or the paid request, and I did not fund, log in, buy, or back up anything; the sandbox wallets were never funded and nothing was signed.All reactions