Skip to content

Commit 3dd5a45

Browse files
committed
fix: update fetch client retrieval to use globalThis for better compatibility
1 parent d7acc79 commit 3dd5a45

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ class Api {
159159
return config.fetch
160160
}
161161

162-
if (typeof window !== 'undefined') {
163-
return window.fetch.bind(window)
162+
if ('fetch' in globalThis) {
163+
return globalThis.fetch
164164
}
165165

166166
throw Error("No client provided and can't find one automatically")

0 commit comments

Comments
 (0)