Skip to content

Add the session kind option to createSession - #85

Merged
vvillait88 merged 1 commit into
mainfrom
session-kind
Sep 9, 2026
Merged

Add the session kind option to createSession#85
vvillait88 merged 1 commit into
mainfrom
session-kind

Conversation

@vvillait88

Copy link
Copy Markdown
Contributor

Summary

createSession gains an optional kind ('kyc' | 'sign_in'). The API already accepts it on POST /v1/sessions: kyc (its default) runs identity verification, sign_in is registration-only (the buyer signs in with an AgentScore account, no identity documents) and mints a sign_in-scoped credential. Merchants that key durable state on the buyer's account without any compliance policy, such as a prepaid metered store, could not mint that kind through the SDK, so their identity bootstrap either did not exist or forced a KYC flow the merchant does not need. SessionCreateResponse also gains the optional kind the API echoes back. When kind is not passed the body omits it, so the API default is unchanged for every existing caller.

Type of change

  • Bug fix (no breaking change)
  • New feature (no breaking change)
  • Breaking change (existing callers must update)
  • Docs, tests, or internal maintenance only

Public API

SessionCreateOptions.kind?: 'kyc' | 'sign_in' (new, optional) and SessionCreateResponse.kind?: 'kyc' | 'sign_in' (new, optional). No migration: existing calls behave exactly as before.

Test plan

tests/index.test.ts: the first-class-fields test now passes kind: 'sign_in' and asserts it lands in the body; a new test asserts the body carries no kind key when the option is absent. Locally: bun run lint, bun run typecheck, bun run test (7 files, 167 passed, 9 skipped).

Checklist

  • Tests cover the new behavior, and the suite passes locally
  • Lint, format, and type checks pass
  • Docs and README examples updated if the public surface changed
  • No secrets, credentials, or personal data in the diff or the tests

Worked with Varun. Version bumped to 2.7.10; the tag follows the merge.

🤖 Generated with Claude Code

The API accepts kind on POST /v1/sessions: kyc runs identity verification,
sign_in is registration-only and mints a sign_in-scoped credential. Merchants
that key durable state on the account with no compliance policy need the
second kind and could not request it through the SDK. Omitted when unset, so
existing callers keep the API default.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@vvillait88
vvillait88 merged commit ebc5f8d into main Sep 9, 2026
6 checks passed
@vvillait88
vvillait88 deleted the session-kind branch September 9, 2026 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant