Skip to content

Move from axios to fetch #372

@brionmario

Description

@brionmario

Current Limitation

The Asgardeo SDKs currently depend on axios for HTTP communication, including request/response interceptors used for:

  • Attaching authorization headers
  • Handling token refresh flows
  • Global error handling

This adds an extra dependency and increases bundle size. It also tightly couples our networking layer to axios, making it harder to modernize or support edge runtimes.

Although migration is not trivial (due to the existing axios interceptor-based refresh logic), continuing with axios limits flexibility.

Suggested Improvement

  1. Introduce a thin internal HTTP abstraction layer.
  2. Implement a fetch-based client.
  3. Replace axios interceptors with a middleware-style pipeline to handle:
    • Auth header injection
    • Token refresh
    • Error normalization
  4. Gradually deprecate and remove axios in a major release.

Please select the package issue is related to

@asgardeo/browser

Version

N/A

Reporter Checklist

  • I have searched the existing issues and this is not a duplicate.
  • I have provided all the necessary information.
  • I have verified the improvement is not available in the latest version of the package.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions