Skip to content

docs: align CDP config examples with actual API in typescript/agentkit README#1270

Open
memosr wants to merge 1 commit into
coinbase:mainfrom
memosr:fix/agentkit-readme-config-fields
Open

docs: align CDP config examples with actual API in typescript/agentkit README#1270
memosr wants to merge 1 commit into
coinbase:mainfrom
memosr:fix/agentkit-readme-config-fields

Conversation

@memosr
Copy link
Copy Markdown

@memosr memosr commented Jun 4, 2026

Summary

Three related corrections to typescript/agentkit/README.md, all stemming from documentation that drifted from the actual TypeScript API. Each one would cause real authentication or import failures for a developer following the README.

Changes

1. Default provider name — CdpWalletProviderCdpSmartWalletProvider

Lines 84 and 95. The README claims the default wallet provider is CdpWalletProvider, but typescript/agentkit/src/agentkit.ts:57 actually defaults to CdpSmartWalletProvider.

The two lines also disagreed with each other — line 84 said WalletProvider, line 95 said WalletActionProvider. Unified both to match the implementation:

- the agent will use the `CdpWalletProvider` and `WalletProvider` action provider
+ the agent will use the `CdpSmartWalletProvider` and `WalletActionProvider`

2. Wrong config field name — apiKeyPrivateapiKeySecret

Lines 111, 130, and ~1358. Three separate code examples for CdpWalletProvider.configureWithWallet() use apiKeyPrivate:

await CdpWalletProvider.configureWithWallet({
  apiKeyId: "CDP API KEY NAME",
  apiKeyPrivate: "CDP API KEY SECRET",  // ← not in CdpProviderConfig
});

But the actual interface at typescript/agentkit/src/wallet-providers/cdp/cdpShared.ts:13 defines the field as apiKeySecret. TypeScript will silently drop the unrecognized field, so following these examples produces a working type-check but a failing runtime authentication call.

Fixed all three occurrences:

- apiKeyPrivate: "CDP API KEY SECRET",
+ apiKeySecret: "CDP API KEY SECRET",

3. Disambiguate adjacent code blocks with conflicting parameter names

Lines 86 and 107. Two code blocks sit right next to each other but use entirely different parameter naming conventions:

  • AgentKit.from() shortcut → cdpApiKeyId / cdpApiKeySecret
  • CdpWalletProvider.configureWithWallet()apiKeyId / apiKeySecret

This is almost certainly the root cause of how the apiKeyPrivate typo propagated to three separate locations in fix #2 — readers copy-paste from the wrong block.

Added a one-line clarifying comment to each block:

+ // When using the AgentKit.from() shortcut:
  const agentKit = AgentKit.from({ ... });
+ // When constructing a wallet provider manually:
  await CdpWalletProvider.configureWithWallet({ ... });

Verification

  • ✅ Only typescript/agentkit/README.md modified
  • ✅ Verified CdpSmartWalletProvider against agentkit.ts:57
  • ✅ Verified apiKeySecret against cdpShared.ts:13
  • ✅ No code changes — doc-only

…t README

Three related corrections to typescript/agentkit/README.md, all stemming
from documentation that drifted from the actual TypeScript API:

1. Default provider name was CdpWalletProvider in the README but the code
   at agentkit.ts:57 actually defaults to CdpSmartWalletProvider. Two
   adjacent lines also disagreed with each other (WalletProvider vs
   WalletActionProvider). Unified both to match the implementation.

2. CdpWalletProvider.configureWithWallet() examples used apiKeyPrivate
   in three places, but the CdpProviderConfig interface at
   wallet-providers/cdp/cdpShared.ts:13 defines the field as
   apiKeySecret. TypeScript silently drops unrecognized fields, so this
   silently breaks authentication. Fixed all 3 occurrences.

3. Two adjacent code blocks use different parameter naming conventions:
   AgentKit.from() takes cdpApiKeyId/cdpApiKeySecret, while
   CdpWalletProvider.configureWithWallet() takes apiKeyId/apiKeySecret.
   Added one-line clarifying comments before each block to prevent
   developers from conflating the two APIs (which is the root cause of
   the apiKeyPrivate typo above propagating across three locations).

Doc-only changes. No code touched.
@memosr memosr requested a review from murrlincoln as a code owner June 4, 2026 12:56
@cb-heimdall
Copy link
Copy Markdown

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 1
Sum 2

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Development

Successfully merging this pull request may close these issues.

2 participants