Summary
The JSDoc comment on the onSuccess callback inside CommonPlaidLinkOptions (src/types/index.ts:93) refers to the first argument as public_key. Since the library migrated to Link Token authentication, the SDK delivers a public_token — the value the host application must POST to /link/token/exchange to obtain an access token. The stale term public_key was part of the older public-key flow and is now incorrect and potentially misleading.
What I observed
src/types/index.ts, lines 91–93:
export interface CommonPlaidLinkOptions<T> {
// A function that is called when a user has successfully connecter an Item.
// The function should expect two arguments, the public_key and a metadata object
onSuccess: T;
The comment says public_key; the actual first argument at runtime is public_token.
(Also noticed in the same comment: connecter should be connected.)
Impact
Developers reading the TypeScript source or generated .d.ts declarations see public_key and may confuse it with the deprecated public-key authentication credential. The correct term public_token is what they exchange via /link/token/exchange.
Suggested fix
One-line change to the comment on line 93 (plus the adjacent connecter → connected typo on line 92):
- // A function that is called when a user has successfully connecter an Item.
- // The function should expect two arguments, the public_key and a metadata object
+ // A function that is called when a user has successfully connected an Item.
+ // The function should expect two arguments, the public_token and a metadata object
Happy to send a PR.
Notes
- The actual TypeScript type
PlaidLinkOnSuccess (defined earlier in the same file) correctly uses public_token — this is purely a comment inconsistency.
- Reference: Plaid Link Token migration guide uses
public_token throughout.
Summary
The JSDoc comment on the
onSuccesscallback insideCommonPlaidLinkOptions(src/types/index.ts:93) refers to the first argument aspublic_key. Since the library migrated to Link Token authentication, the SDK delivers apublic_token— the value the host application must POST to/link/token/exchangeto obtain an access token. The stale termpublic_keywas part of the older public-key flow and is now incorrect and potentially misleading.What I observed
src/types/index.ts, lines 91–93:The comment says
public_key; the actual first argument at runtime ispublic_token.(Also noticed in the same comment:
connectershould beconnected.)Impact
Developers reading the TypeScript source or generated
.d.tsdeclarations seepublic_keyand may confuse it with the deprecated public-key authentication credential. The correct termpublic_tokenis what they exchange via/link/token/exchange.Suggested fix
One-line change to the comment on line 93 (plus the adjacent
connecter→connectedtypo on line 92):Happy to send a PR.
Notes
PlaidLinkOnSuccess(defined earlier in the same file) correctly usespublic_token— this is purely a comment inconsistency.public_tokenthroughout.