Summary
Following up on PR thunder-id/javascript-sdks#9, which migrated the packages/react SDK's profile self-service flow from SCIM-based /scim2/Me requests to standard /users/me requests, we should evaluate the API functions in packages/react/src/api to ensure the surface is consistent, well-documented, and free of dead code after the migration.
Rationale
The migration changed several exported functions/interfaces (e.g. getUsersMe, updateMeProfile, and the getMeProfile re-export in packages/react/src/index.ts), and removed SCIM2 schema-related types and exports. A dedicated pass would help confirm:
- Naming consistency between the React-specific wrappers (e.g.
getUsersMe in packages/react/src/api/getUsersMe.ts) and the underlying @thunderid/browser functions they wrap.
- Whether default fetcher implementations (e.g.
defaultFetcher in packages/react/src/api/getUsersMe.ts and packages/react/src/api/updateMeProfile.ts) are duplicated unnecessarily across files and could be extracted into a shared helper.
- Whether all exported API functions/types in
packages/react/src/api are still referenced from packages/react/src/index.ts and used correctly by consumers (e.g. BaseUserProfile.tsx, UserProfile.tsx, ThunderIDProvider.tsx).
- Whether JSDoc examples and error-handling behavior (headers, status codes,
ThunderIDAPIError usage) are consistent across all API functions post-migration.
Affected areas
packages/react/src/api/getUsersMe.ts
packages/react/src/api/updateMeProfile.ts
packages/react/src/index.ts
Acceptance criteria
References
Requested by: @janithjay
Summary
Following up on PR
thunder-id/javascript-sdks#9, which migrated thepackages/reactSDK's profile self-service flow from SCIM-based/scim2/Merequests to standard/users/merequests, we should evaluate the API functions inpackages/react/src/apito ensure the surface is consistent, well-documented, and free of dead code after the migration.Rationale
The migration changed several exported functions/interfaces (e.g.
getUsersMe,updateMeProfile, and thegetMeProfilere-export inpackages/react/src/index.ts), and removed SCIM2 schema-related types and exports. A dedicated pass would help confirm:getUsersMeinpackages/react/src/api/getUsersMe.ts) and the underlying@thunderid/browserfunctions they wrap.defaultFetcherinpackages/react/src/api/getUsersMe.tsandpackages/react/src/api/updateMeProfile.ts) are duplicated unnecessarily across files and could be extracted into a shared helper.packages/react/src/apiare still referenced frompackages/react/src/index.tsand used correctly by consumers (e.g.BaseUserProfile.tsx,UserProfile.tsx,ThunderIDProvider.tsx).ThunderIDAPIErrorusage) are consistent across all API functions post-migration.Affected areas
packages/react/src/api/getUsersMe.tspackages/react/src/api/updateMeProfile.tspackages/react/src/index.tsAcceptance criteria
packages/react/src/apifor consistency in naming, headers, error handling, and documentation.References
PUT /users/mejavascript-sdks#9PUT /users/mejavascript-sdks#9 (comment)Requested by:
@janithjay