Frequently asked questions
Short answers to the questions we hear most. Can't find yours? Ask in GitHub Discussions.
On this page
#General
#How is Relay different from Axios?
Relay is built on the standard fetch API instead of XMLHttpRequest, so it works in edge runtimes and service workers and is about a fifth of the size. It also retries and times out by default. Axios has a larger ecosystem and supports upload progress events in older browsers.
#Why not just use fetch?
You can! Relay is fetch plus the helpers most apps write anyway: timeouts, retries, JSON handling, errors for non-2xx statuses and interceptors.
#Is Relay production ready?
Yes. Relay has been stable since 2023, is tested on six runtimes in CI and follows semantic versioning.
#Usage
#Does Relay work with server-side rendering?
Yes. It uses the global fetch, which exists in Node.js 18+, Deno, Bun and every major SSR framework. Pass a custom fetch if your framework provides one.
#How do I send cookies with cross-origin requests?
Set credentials: 'include' on the request or instance. The server must also allow credentials in its CORS headers.
#Can I track upload progress?
Not yet. The fetch API doesn't expose upload progress in all browsers. It's on the roadmap for when support lands everywhere.
#Project
#What license is Relay under?
MIT. You can use it in commercial and open-source projects.
#How can I contribute?
Read the contributing guide in the GitHub repository, then open an issue to discuss bigger changes before sending a pull request.
Was this page helpful?
Last updated