## Index

### References

- initialise
- initialize

### Namespaces

- <internal>
- account
- apps
- crypto
- dataRoot
- did
- dns
- errors
- ipfs
- keystore
- lobby
- machinery
- path
- setup
- ucan

### Enumerations

- AppScenario
- InitialisationError
- Scenario

### Type aliases

- AppInitOptions
- AppState
- AuthCancelled
- AuthSucceeded
- Authed
- Continuation
- NotAuthed
- NotAuthorised
- PermissionedAppInitOptions
- State

### Variables

- VERSION
- WASM_WNFS_VERSION
- fs

### Functions

- app
- authenticatedUsername
- bootstrapFileSystem
- bootstrapRootFileSystem
- checkFileSystemVersion
- isSupported
- leave
- loadFileSystem
- loadRootFileSystem
- permissionedApp
- readKey
- redirectToLobby

## References

### initialise

Renames and re-exports permissionedApp

### initialize

Renames and re-exports permissionedApp

## Type aliases

### AppInitOptions

AppInitOptions: { loadFileSystem?: boolean; rootKey?: string; useWnfs?: boolean }

- Defined in init/types.ts:19

#### Type declaration

- ##### Optional loadFileSystem?: boolean

- ##### Optional rootKey?: string

- ##### Optional useWnfs?: boolean

### AppState

AppState: NotAuthed | Authed

- Defined in auth/state/app.ts:40

### AuthCancelled

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

- Defined in auth/state/permissionedApp.ts:118

### AuthSucceeded

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

- Defined in auth/state/permissionedApp.ts:106

### Authed

Authed: AppBase & { authenticated: true; fs?: FileSystem; scenario: Authed; username: string }

- Defined in auth/state/app.ts:54

### Continuation

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

- Defined in auth/state/permissionedApp.ts:127

### NotAuthed

NotAuthed: AppBase & { authenticated: false; scenario: NotAuthed }

- Defined in auth/state/app.ts:48

### NotAuthorised

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

- Defined in auth/state/permissionedApp.ts:99

### PermissionedAppInitOptions

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

- Defined in init/types.ts:26

#### Type declaration

- ##### Optional autoRemoveUrlParams?: boolean

- ##### Optional loadFileSystem?: boolean

- ##### Optional permissions?: Permissions

- ##### Optional rootKey?: string

### State

State: NotAuthorised | AuthSucceeded | AuthCancelled | Continuation

- Defined in auth/state/permissionedApp.ts:87

## Variables

### Const VERSION

VERSION: "0.34.2" = "0.34.2"

- Defined in common/version.ts:1

### Const WASM_WNFS_VERSION

WASM_WNFS_VERSION: "0.1.7" = "0.1.7"

- Defined in common/version.ts:2

### Const fs

fs: typeof FileSystem = FileSystem

- Defined in index.ts:182

## Functions

### app

- app(options: AppInitOptions): Promise<AppState>

- - Defined in index.ts:35

  Check if we're authenticated 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: AppInitOptions

  #### Returns Promise<AppState>

### authenticatedUsername

- authenticatedUsername(): Promise<string | null>

- - Defined in auth.ts:22

  Retrieve the authenticated username.

  #### Returns Promise<string | null>

### bootstrapFileSystem

- bootstrapFileSystem(permissions: Permissions, options?: { reset?: boolean }): Promise<FileSystem>

- - Defined in filesystem.ts:113

  Create a new filesystem and assign it to a user.

  #### Parameters

  - ##### permissions: Permissions

    The permissions to initialize the filesystem

  - ##### options: { reset?: boolean } = ...

    Optional params

    - ##### Optional reset?: boolean

      Override an existing filesystem with an empty one

  #### Returns Promise<FileSystem>

### bootstrapRootFileSystem

- bootstrapRootFileSystem(options?: { reset?: boolean }): Promise<FileSystem>

- - Defined in filesystem.ts:226

  Create a new filesystem with public and private roots and assign it to a user.

  #### Parameters

  - ##### options: { reset?: boolean } = ...

    Optional params

    - ##### Optional reset?: boolean

      Override an existing filesystem with an empty one

  #### Returns Promise<FileSystem>

### checkFileSystemVersion

- checkFileSystemVersion(filesystemCID: CID): Promise<void>

- - Defined in filesystem.ts:168

  #### Parameters

  - ##### filesystemCID: CID

  #### Returns Promise<void>

### isSupported

- isSupported(): Promise<boolean>

- - Defined in index.ts:162

  #### Returns Promise<boolean>

### leave

- leave(__namedParameters?: { withoutRedirect?: boolean }): Promise<void>

- - Defined in auth.ts:31

  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>

- - Defined in filesystem.ts:35

  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>

### loadRootFileSystem

- loadRootFileSystem(): Promise<FileSystem>

- - Defined in filesystem.ts:216

  Load a user's root file system.

  #### Returns Promise<FileSystem>

### permissionedApp

- permissionedApp(options: PermissionedAppInitOptions): Promise<State>

- - Defined in index.ts:93

  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: PermissionedAppInitOptions

  #### Returns Promise<State>

### readKey

- readKey(): Promise<string>

- - Defined in filesystem.ts:255

  Create or get a read key for accessing the WNFS private root.

  #### Returns Promise<string>

### redirectToLobby

- redirectToLobby(permissions: Maybe<Permissions>, redirectTo?: string, extraLobbyParams?: Record<string, string>): Promise<void>

- - Defined in auth.ts:57

  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