You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TypeScript SDK: drop axios in favor of the generated fetch client? #5534
The TypeScript SDK ships axios as a runtime dependency (seen on 1.46.0, still present on 1.47.2). It has led to dependency audit findings in our project that we then have to work around, and dropping it would be cleaner.
I read through sdks/typescript and it doesn't look critically dependent on axios:
src/clients/rest/generated-fetch/ is already generated from the same OpenAPI spec, and core/client.ts builds on it via createFetchApi.
rest-api.ts defines a RestApi type that both generated clients satisfy, so the feature clients are written once.
The fetch client serializes array query params as repeated keys, matching the qsarrayFormat: 'repeat' setting the axios client uses.
The remaining axios usage is the generated src/clients/rest/generated/ client, rest/api.ts (auth header, qs serializer, https.Agent for NODE_TLS_REJECT_UNAUTHORIZED=0), the axiosConfig parameter threaded through HatchetClient, LegacyHatchetClient and embedded.ts, and isAxiosError checks in streams.ts and rest/errors.ts.
The one public surface I see is axiosConfig?: AxiosRequestConfig on HatchetClient.init. Users passing proxies, agents or timeouts through it would break.
I'm happy to take a stab at this. Before I start, which would you prefer?
A deprecation path first: keep axiosConfig working for a release or two while adding a fetch-style option (for example a custom fetch or dispatcher), then remove axios in the next major.
A PR with the full rewrite right away, treating the change as breaking.
If there are behaviors you know the axios client relies on that the fetch client doesn't cover, let me know 🤘
Activity