OptionalauthAn OAuth client provider to use for authentication.
token() is called before every request to obtain the
bearer token. When the server responds with 401, onUnauthorized()
is called (if provided) to refresh credentials, then the request is retried once. If
the retry also gets 401, or onUnauthorized is not provided, UnauthorizedError
is thrown.
For simple bearer tokens: { token: async () => myApiKey }.
For OAuth flows, pass an OAuthClientProvider implementation.
Interactive flows: after UnauthorizedError, redirect the user, then call
finishAuth with the authorization code before reconnecting.
OptionaleventCustomizes the initial SSE request to the server (the request that begins the stream).
NOTE: Setting this property will prevent an Authorization header from
being automatically attached to the SSE request, if an authProvider is
also given. This can be worked around by setting the Authorization header
manually.
OptionalfetchCustom fetch implementation used for all network requests.
OptionalrequestCustomizes recurring POST requests to the server.
Configuration options for the
SSEClientTransport.