Skip to content

Evaluate API functions in the react package #3883

Description

@coderabbitai

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

  • Review all exported functions/types under packages/react/src/api for consistency in naming, headers, error handling, and documentation.
  • Identify and consolidate duplicated logic (e.g. default fetcher adapters) where feasible.
  • Confirm all public exports are still needed and correctly wired to consumers.
  • File follow-up PRs for any concrete refactors identified.

References

Requested by: @janithjay

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions