@adcp/sdk API Reference - v7.9.0
    Preparing search index...

    Interface ImplicitAccountStoreOptions<TCtxMeta>

    Constructor options for InMemoryImplicitAccountStore.

    interface ImplicitAccountStoreOptions<TCtxMeta = Record<string, unknown>> {
        buildAccount?: (
            ref: AccountReference,
            ctx?: ResolveContext,
        ) => Account<TCtxMeta> | Promise<Account<TCtxMeta>>;
        keyFn?: (authInfo: ResolvedAuthInfo) => string | undefined;
        ttlMs?: number;
    }

    Type Parameters

    • TCtxMeta = Record<string, unknown>
    Index

    Properties

    buildAccount?: (
        ref: AccountReference,
        ctx?: ResolveContext,
    ) => Account<TCtxMeta> | Promise<Account<TCtxMeta>>

    Convert a buyer-supplied AccountReference (from sync_accounts) to the seller's Account<TCtxMeta>. Called once per ref in upsert().

    Default: builds a synthetic account from the ref fields. Suitable for tests; replace for production (call your platform's account-lookup or account-creation API here).

    keyFn?: (authInfo: ResolvedAuthInfo) => string | undefined

    Extract the principal key from ResolvedAuthInfo. The returned string is the lookup key for the authInfo → accounts mapping.

    Default: defaultImplicitKeyFn — uses credential.client_id (oauth), credential.key_id (api_key), or credential.agent_url (http_sig). Stable across token rotations within the same credential kind.

    Override when your platform keys on a custom claim (e.g., a sub-derived tenant ID in authInfo.extra).

    ttlMs?: number

    Sync-linkage TTL in milliseconds. Entries stored by upsert() expire after this duration; resolve() returns null (→ ACCOUNT_NOT_FOUND) for expired entries, prompting the buyer to call sync_accounts again.

    Default: 86_400_000 (24 hours). Align with your platform's session or token lifetime; longer TTLs risk serving stale account state.

    Distinct from AccountStore.refreshToken — that refreshes the upstream OAuth token mid-request. This TTL governs how long the sync-linkage itself is valid before a fresh sync_accounts is required.