jazz-browser

Context Creation

createJazzBrowserContext<Acc>(options): Promise<BrowserContext<Acc>>
options: BrowserContextOptions<Acc>
createJazzBrowserContext(options): Promise<BrowserGuestContext>
options: BaseBrowserContextOptions
createJazzBrowserContext<Acc>(options): Promise<BrowserGuestContext | BrowserContext<Acc>>
options: BrowserContextOptions<Acc> | BaseBrowserContextOptions

type BrowserContext

type BrowserContext<Acc extends Account> = { me: Acc, logOut: () => void, done: () => void }

⚠️ undocumented

Auth Providers

type SessionProvider

type SessionProviderundefined = (accountID: AgentID | ID<Account>) => Promise<SessionID>

⚠️ undocumented
BrowserDemoAuth provides a JazzAuth object for demo authentication.

Demo authentication is useful for quickly testing your app, as it allows you to create new accounts and log in as existing ones. The authentication persists across page reloads, with the credentials stored in
localStorage.

import { BrowserDemoAuth } from "jazz-browser";

const auth = new BrowserDemoAuth(driver);
BrowserPasskeyAuth provides a JazzAuth object for passkey authentication.

import { BrowserPasskeyAuth } from "jazz-browser";

const auth = new BrowserPasskeyAuth(driver, appName);
BrowserPassphraseAuth provides a JazzAuth object for passphrase authentication.

import { BrowserPassphraseAuth } from "jazz-browser";

const auth = new BrowserPassphraseAuth(driver, wordlist, appName);

Invite Links

consumeInviteLinkFromWindowLocation<V>({ as, invitedObjectSchema, forValueHint? }): Promise<{ valueID: ID<V>, inviteSecret: InviteSecret, valueHint: string } | undefined>
{ as: Account, invitedObjectSchema: CoValueClass<V>, forValueHint: string }

Other

provideBrowserLockSession(accountID, crypto): Promise<{ sessionID: TODO type templateLiteral | TODO type templateLiteral, sessionDone: () => void }>
accountID: ID<Account> | TODO type templateLiteral,
crypto: CryptoProvider<any>

type BrowserGuestContext

type BrowserGuestContextundefined = { guest: AnonymousJazzAgent, logOut: () => void, done: () => void }

⚠️ undocumented

type BrowserContextOptions

type BrowserContextOptions<Acc extends Account> = { auth: AuthMethod, AccountSchema: CoValueClass<Acc> & { fromNode: Account["fromNode"] } } & BaseBrowserContextOptions

⚠️ undocumented

type BaseBrowserContextOptions

type BaseBrowserContextOptionsundefined = { peer: TODO type templateLiteral | TODO type templateLiteral, reconnectionTimeout: number, storage: StorageConfig, crypto: CryptoProvider }

⚠️ undocumented