Options
All
  • Public
  • Public/Protected
  • All
Menu

Fission SDK - v0.23.2

Index

References

initialize

Renames and exports initialise

Type aliases

AuthCancelled

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

Type declaration

  • authenticated: false
  • cancellationReason: string
  • permissions: Maybe<Permissions>
  • scenario: AuthCancelled
  • throughLobby: true

AuthSucceeded

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

Type declaration

  • authenticated: true
  • Optional fs?: FileSystem
  • newUser: boolean
  • permissions: Maybe<Permissions>
  • scenario: AuthSucceeded
  • throughLobby: true
  • username: string

Continuation

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

Type declaration

  • authenticated: true
  • Optional fs?: FileSystem
  • newUser: false
  • permissions: Maybe<Permissions>
  • scenario: Continuation
  • throughLobby: false
  • username: string

NotAuthorised

NotAuthorised: { authenticated: false; permissions: Maybe<Permissions>; scenario: NotAuthorised }

Type declaration

  • authenticated: false
  • permissions: Maybe<Permissions>
  • scenario: NotAuthorised

State

Variables

Const VERSION

VERSION: "0.23.0" = "0.23.0"

Const fs

fs: typeof FileSystem = ...

Functions

authenticatedUsername

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

    Returns Promise<string | null>

initialise

  • initialise(options: { autoRemoveUrlParams?: boolean; loadFileSystem?: boolean; permissions?: Permissions; rootKey?: string }): Promise<State>
  • 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

    • options: { autoRemoveUrlParams?: boolean; loadFileSystem?: boolean; permissions?: Permissions; rootKey?: string }
      • Optional autoRemoveUrlParams?: boolean
      • Optional loadFileSystem?: boolean
      • Optional permissions?: Permissions
      • Optional rootKey?: string

    Returns Promise<State>

isSupported

  • isSupported(): Promise<boolean>

leave

  • 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>

loadFileSystem

  • loadFileSystem(permissions: Maybe<Permissions>, username?: string, rootKey?: string): Promise<FileSystem>
  • 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

  • redirectToLobby(permissions: Maybe<Permissions>, redirectTo?: 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.

    Returns Promise<void>

Generated using TypeDoc