ProtectedbuildProtectedfetchProtectedisProtectedrequestVerifies if the current user is allowed to send the given request.
the request's method.
the path to the resource.
Optionalbody: string | objectthe request's body.
a promise that resolves to true if it's allowed or false otherwise.
ProtectedresolveURLProtectedstreamReads an EventSource from the endpoint. Differently than the original specification, this allows common HTTP requests with method and body to be made.
the url or request object.
Optionalinit: RequestInitthe fetch options.
a promise with a FetchEventStream, which is an AsyncGenerator.
StaticsetupSets up all network clients. Must be called before attempting to make any request.
An object with functions capable of checking, retrieving and ending the current session.
The environment to send the requests to.
Makes a request (same signature as
globalThis.fetch). This request will prepend the base url to the url and, if there's an active session, include authentication headers.