I was also trying to use the anthropic sdk from a plugin. Does the node-fetch approach work on mobile? If not, an approach that does work on both desktop and mobile is to write a shim implementing the fetch
method that uses Obsidian’s requestUrl
under the hood, then pass it as the fetch
option to Anthropic
’s constructor. Here’s my implementation: obsidian-auto-image-alt-plugin/src/generation.ts at 2a99d96595d8db472c0716f552f326c35227164e · brokensandals/obsidian-auto-image-alt-plugin · GitHub