Options
All
  • Public
  • Public/Protected
  • All
Menu

Fission SDK

Index

References

Renames and re-exports initialise

Type aliases

AuthCancelled: { authenticated: false; cancellationReason: string; permissions: Maybe<Permissions>; scenario: AuthCancelled; throughLobby: true }

Type declaration

AuthSucceeded: { authenticated: true; fs?: FileSystem; newUser: boolean; permissions: Maybe<Permissions>; scenario: AuthSucceeded; throughLobby: true; username: string }

Type declaration

Continuation: { authenticated: true; fs?: FileSystem; newUser: false; permissions: Maybe<Permissions>; scenario: Continuation; throughLobby: false; username: string }

Type declaration

InitOptions: { autoRemoveUrlParams?: boolean; loadFileSystem?: boolean; permissions?: Permissions; rootKey?: string }

Type declaration

  • Optional autoRemoveUrlParams?: boolean
  • Optional loadFileSystem?: boolean
  • Optional permissions?: Permissions
  • Optional rootKey?: string
NotAuthorised: { authenticated: false; permissions: Maybe<Permissions>; scenario: NotAuthorised }

Type declaration

Variables

VERSION: "0.31.0" = "0.31.0"
fs: typeof FileSystem = FileSystem

Functions

  • authenticatedUsername(): Promise<string | null>
  • Retrieve the authenticated username.

    Returns Promise<string | null>

  • checkFileSystemVersion(filesystemCID: CID): Promise<void>
  • Check if we're authenticated, process any lobby query-parameters present in the URL, and initiate the user's file system if authenticated (can be disabled).

    See loadFileSystem if you want to load the user's file system yourself. NOTE: Only works on the main/ui thread, as it uses window.location.

    Parameters

    Returns Promise<State>

  • isSupported(): Promise<boolean>
  • leave(__namedParameters?: { withoutRedirect?: boolean }): Promise<void>
  • Leave.

    Removes any trace of the user and redirects to the lobby.

    Parameters

    • __namedParameters: { withoutRedirect?: boolean } = {}
      • Optional withoutRedirect?: boolean

    Returns Promise<void>

  • Load a user's file system.

    Parameters

    • permissions: Maybe<Permissions>

      The permissions from initialise. Pass null if working without permissions

    • Optional username: string

      Optional, username of the user to load the file system from. Will try to load the file system of the authenticated user by default. Throws an error if there's no authenticated user.

    • Optional rootKey: string

      Optional, AES key to be the root key of a new filesystem. Will be used if a filesystem hasn't been created yet.

    Returns Promise<FileSystem>

  • redirectToLobby(permissions: Maybe<Permissions>, redirectTo?: string, extraLobbyParams?: Record<string, string>): Promise<void>
  • Redirects to a lobby.

    NOTE: Only works on the main thread, as it uses window.location.

    Parameters

    • permissions: Maybe<Permissions>

      The permissions from initialise. Pass null if working without permissions.

    • Optional redirectTo: string

      Specify the URL you want users to return to. Uses the current url by default.

    • Optional extraLobbyParams: Record<string, string>

      Extra parameters object. Properties on the object are converted to query params and sent to the auth lobby.

    Returns Promise<void>

Generated using TypeDoc