The SDK's request and response types are written by hand and maintained in parallel with the api's Zod schemas. fells-code/seamless-auth-types#4 publishes them, so they can be imported instead.
src/types.ts:
User, Organization, and OrganizationMembership map to MeUser, Organization, and OrganizationMembership in the package.
Credential maps to CredentialResponse. The local one types lastUsedAt as Date | null, but the api returns an ISO string, so anything calling a Date method on it is relying on a type that does not match the wire value.
src/client/createSeamlessAuthClient.ts redeclares roughly twenty shapes that now exist upstream: LoginMethod, LoginStartResult, RegisterInput, CurrentUserResult, the four organization input types plus the five organization result types, OAuthProvider and its results, StartOAuthLoginResult, CredentialUpdateResult, StepUpMethod, StepUpStatus, TotpStatus, TotpEnrollmentStartResult, LogoutScope, and MessageResult.
src/client/errors.ts keeps OAuthErrorCode and OAUTH_ERROR_CODES as a hand-maintained pair. The package exports both, so getOAuthErrorCode can validate against OAuthErrorCodeSchema and the local Set goes away.
Two things worth keeping local, since they are SDK concerns rather than wire contracts: the PRF helpers in src/client/webauthnPrf.ts, and SeamlessAuthResult in src/client/result.ts.
One thing to decide as part of this: whether the package becomes a runtime dependency or a types-only one. Zod is the package's single dependency, and importing schemas rather than just types would let the SDK validate responses instead of casting them, at the cost of adding Zod to the browser bundle.
The SDK's request and response types are written by hand and maintained in parallel with the api's Zod schemas. fells-code/seamless-auth-types#4 publishes them, so they can be imported instead.
src/types.ts:User,Organization, andOrganizationMembershipmap toMeUser,Organization, andOrganizationMembershipin the package.Credentialmaps toCredentialResponse. The local one typeslastUsedAtasDate | null, but the api returns an ISO string, so anything calling aDatemethod on it is relying on a type that does not match the wire value.src/client/createSeamlessAuthClient.tsredeclares roughly twenty shapes that now exist upstream:LoginMethod,LoginStartResult,RegisterInput,CurrentUserResult, the four organization input types plus the five organization result types,OAuthProviderand its results,StartOAuthLoginResult,CredentialUpdateResult,StepUpMethod,StepUpStatus,TotpStatus,TotpEnrollmentStartResult,LogoutScope, andMessageResult.src/client/errors.tskeepsOAuthErrorCodeandOAUTH_ERROR_CODESas a hand-maintained pair. The package exports both, sogetOAuthErrorCodecan validate againstOAuthErrorCodeSchemaand the localSetgoes away.Two things worth keeping local, since they are SDK concerns rather than wire contracts: the PRF helpers in
src/client/webauthnPrf.ts, andSeamlessAuthResultinsrc/client/result.ts.One thing to decide as part of this: whether the package becomes a runtime dependency or a types-only one. Zod is the package's single dependency, and importing schemas rather than just types would let the SDK validate responses instead of casting them, at the cost of adding Zod to the browser bundle.