UNET API - v0.0.0
    Preparing search index...

    Class UnetId

    Index
    • Redirects the browser to unet.social. Finish with handleRedirectCallback() on the return page.

      Parameters

      Returns Promise<void>

    • True if the current URL looks like an authorization response for this app.

      Parameters

      • url: string = globalThis.location.href

      Returns boolean

    • Call on the return page. Validates state, exchanges the code (PKCE, no secret) and loads the profile. Resolves with the user and the returnTo passed to signIn. Throws AccessDenied / StateMismatch / UnetIdError / NetworkError.

      Parameters

      • url: string = globalThis.location.href

      Returns Promise<{ user: UnetUser; returnTo: string }>

    • Load a previous session (call once on startup). Returns null if signed out.

      Parameters

      • options: { revalidate?: boolean } = {}

      Returns Promise<UnetUser | null>

    • Re-reads the profile from UNET (e.g. after the user changed their name elsewhere).

      Returns Promise<UnetUser>

    • Scopes the server granted for this session; null if signed out. Falls back to the requested scopes if the server did not say.

      Returns string[] | null

    • Whether the session has scope — check before calling, instead of catching InsufficientScope.

      Parameters

      • scope: string

      Returns boolean

    • Returns boolean

    • A valid access token, refreshed automatically (single in-flight refresh).

      Parameters

      • force: boolean = false

      Returns Promise<string>

    • Revokes tokens on the server (best effort) and clears local state.

      Returns Promise<void>

    • Parameters

      Returns () => void

    api: UnetApi

    UNET REST API (feed, posts, profiles, search, comments, follows, ...). Each call needs its permission, see UnetApi.