Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use fetch instead of Axios or use Axios adpater for fetch #25

Open
theetherGit opened this issue Apr 23, 2024 · 0 comments
Open

Use fetch instead of Axios or use Axios adpater for fetch #25

theetherGit opened this issue Apr 23, 2024 · 0 comments

Comments

@theetherGit
Copy link

  • I'm submitting a ...
    [x] feature request

  • Summary
    Currently this SDK uses Axios and axios is not supported in many edge service like Cloudflare workers and vercel edge(might support now they have migrated to node again). But for Cloudflare worker this is a issue.

  • Other information (e.g. detailed explanation, stack traces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)
    I'm suggesting you to use a fetch adapter e.g @haverstack/axios-fetch-adapter which adds fetch instead of Axios inbuilt request adapter. This will fix the cloudflare workers/pages deployment issue.

import axios from "axios";
import fetchAdapter from "@haverstack/axios-fetch-adapter";

const client = axios.create({
  adapter: fetchAdapter
});
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

No branches or pull requests

1 participant