Pass custom fetch to mastra client
Hi I would like to request a parameter to the mastra client which would be a "fetch" mostly like in ai-sdk. My use case is that I'm using tauri and i need to pass tauri custom fetch in order to not get timeout error on macos. Tauri uses macos webview which is based on safari and safari stablishes a default timeout which can't be changed unless using Tauri fetch plugin.
I would like to do something like
new MastraClient({baseURl:URL, fetch:fetch}) or similar
also i'd like to report that the docs on the mastra client are outdated as tool.execute() does not take 'args' anymore but a 'data' https://mastra.ai/reference/client-js/toolsReference: Tools API | Client SDK | Mastra Docs
Learn how to interact with and execute tools available in the Mastra platform using the client-js SDK.
4 Replies
๐ Created GitHub issue: https://github.com/mastra-ai/mastra/issues/10673
๐ If you're experiencing an error, please provide a minimal reproducible example whenever possible to help us resolve it quickly.
๐ Thank you for helping us improve Mastra!
hey @Omicrxn ill have a PR shortly
Fast as hell as usual, appreciate it @Abhi Aiyer!
haha thanks! https://github.com/mastra-ai/mastra/pull/10677
GitHub
feat: add custom fetch support to MastraClient by abhiaiyer91 ยท Pu...
Adds support for passing a custom fetch function to MastraClient, similar to how ai-sdk handles it. This is useful for environments like Tauri that require custom fetch implementations to avoid tim...