We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
window
1 parent 65ae121 commit 87f4d8bCopy full SHA for 87f4d8b
libs/api/index.ts
@@ -25,6 +25,13 @@ export const api = new Api({
25
host: process.env.NODE_ENV === 'test' ? 'http://testhost' : '',
26
})
27
28
+// add the API client to window for use from the browser JS console. requests
29
+// will use the session cookie, same as normal API calls
30
+if (typeof window !== 'undefined') {
31
+ // @ts-expect-error
32
+ window.oxide = api.methods
33
+}
34
+
35
export type ApiMethods = typeof api.methods
36
37
export const useApiQuery = getUseApiQuery(api.methods)
0 commit comments