Functions#
Functions#
events#
▸ events(): ISessionEventListener
SessionEventEmitter instance to subscribe to events by the default session.
Returns#
Since
1.14.0
Defined in#
fetch#
▸ fetch(input
, init?
): Promise
<Response
>
This function’s signature is equal to window.fetch
, but if the current user is authenticated
(see [[login]] and [[handleIncomingRedirect]]), requests made using it will include that user’s
credentials. If not, this will behave just like the regular window.fetch
.
Parameters#
Name |
Type |
---|---|
|
|
|
|
Returns#
Promise
<Response
>
See
https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch
Since
1.3.0
Defined in#
packages/browser/src/defaultSession.ts:52
▸ fetch(input
, init?
): Promise
<Response
>
This function’s signature is equal to window.fetch
, but if the current user is authenticated
(see [[login]] and [[handleIncomingRedirect]]), requests made using it will include that user’s
credentials. If not, this will behave just like the regular window.fetch
.
Parameters#
Name |
Type |
---|---|
|
|
|
|
Returns#
Promise
<Response
>
See
https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch
Since
1.3.0
Defined in#
getDefaultSession#
▸ getDefaultSession(): Session
Obtain the Session used when not explicitly instantiating one yourself.
When using the top-level exports fetch, login, logout, handleIncomingRedirect, onLogin and onLogout, these apply to an implicitly-instantiated Session. This function returns a reference to that Session in order to obtain e.g. the current user’s WebID.
Returns#
Since
1.3.0
Defined in#
handleIncomingRedirect#
▸ handleIncomingRedirect(inputOptions?
): Promise
<undefined
| ISessionInfo
>
Completes the login process by processing the information provided by the Solid identity provider through redirect.
Parameters#
Name |
Type |
---|---|
|
|
Returns#
Promise
<undefined
| ISessionInfo
>
Since
1.3.0
Defined in#
login#
▸ login(options
): Promise
<void
>
Triggers the login process. Note that this method will redirect the user away from your app.
Parameters#
Name |
Type |
Description |
---|---|---|
|
Parameter to customize the login behaviour. In particular, two options are mandatory: |
Returns#
Promise
<void
>
This method should redirect the user away from the app: it does not return anything. The login process is completed by [[handleIncomingRedirect]].
Since
1.3.0
Defined in#
logout#
▸ logout(options?
): Promise
<void
>
Logs the user out of the application.
By default this does not log the user out of their Solid identity provider.
In order to do so, you must set the logoutType to idp
. For usage details
see Session.logout.
Parameters#
Name |
Type |
---|---|
|
Returns#
Promise
<void
>
Since
1.3.0