index.ts overview

Svelte bindings for the effect-auth client: atomStore adapts any Atom to Svelte’s store contract, so the session Atoms work with $store, and unstyled form components for sign-in, sign-up, password reset, magic links and email codes reach the client through setAuthClient.

Example

The session as Svelte stores
```svelte
<script>
  import * as Option from "effect/Option";
  const session = sessionStore(registry, auth);
</script>
{#if Option.isSome($session.data)}Signed in as {$session.data.value.user.email}{/if}

---
## Exports Grouped by Category
- [AuthFormClasses](#authformclasses)
- [AuthSuccess](#authsuccess)
- [EmailOtpForm](#emailotpform)
- [EmailOtpFormProps](#emailotpformprops)
- [EmailOtpLabels](#emailotplabels)
- [EmailOtpPurpose](#emailotppurpose)
- [FormFailure](#formfailure)
- [ListSessionsState (type alias)](#listsessionsstate-type-alias)
- [ListSessionsStore (interface)](#listsessionsstore-interface)
- [MagicLinkForm](#magiclinkform)
- [MagicLinkFormProps](#magiclinkformprops)
- [MagicLinkLabels](#magiclinklabels)
- [PasswordResetConfirmForm](#passwordresetconfirmform)
- [PasswordResetConfirmFormProps](#passwordresetconfirmformprops)
- [PasswordResetConfirmLabels](#passwordresetconfirmlabels)
- [PasswordResetRequestForm](#passwordresetrequestform)
- [PasswordResetRequestFormProps](#passwordresetrequestformprops)
- [PasswordResetRequestLabels](#passwordresetrequestlabels)
- [Readable (interface)](#readable-interface)
- [SecondFactorChallenge](#secondfactorchallenge)
- [SendCaptchaProps](#sendcaptchaprops)
- [SignInForm](#signinform)
- [SignInFormProps](#signinformprops)
- [SignInLabels](#signinlabels)
- [SignUpForm](#signupform)
- [SignUpFormProps](#signupformprops)
- [SignUpLabels](#signuplabels)
- [StatusResponse](#statusresponse)
- [atomStore](#atomstore)
- [authClientKey](#authclientkey)
- [getAuthClient](#getauthclient)
- [listSessionsStore](#listsessionsstore)
- [sessionStore](#sessionstore)
- [setAuthClient](#setauthclient)
---

# utils

## AuthFormBaseProps

**Signature**

```ts
declare const AuthFormBaseProps: AuthFormBaseProps<TResult>

Source

AuthFormClasses

Signature

declare const AuthFormClasses: AuthFormClasses

Source

AuthSuccess

Signature

declare const AuthSuccess: AuthResult

Source

EmailOtpForm

Signature

declare const EmailOtpForm: LegacyComponentType

Source

EmailOtpFormProps

Signature

declare const EmailOtpFormProps: EmailOtpFormProps

Source

EmailOtpLabels

Signature

declare const EmailOtpLabels: EmailOtpLabels

Source

EmailOtpPurpose

Signature

declare const EmailOtpPurpose: "sign-in" | "email-verification" | "forget-password"

Source

FormFailure

Signature

declare const FormFailure: FormFailure

Source

ListSessionsState (type alias)

The state listSessionsStore emits.

Signature

type ListSessionsState = SessionListState

Source

ListSessionsStore (interface)

A readable store over the user’s active sessions, with a refetch handle.

Signature

export interface ListSessionsStore extends Readable<ListSessionsState> {
  /** Re-read the list (after revoking a session, say). */
  readonly refetch: () => void
}

Source

MagicLinkForm

Signature

declare const MagicLinkForm: LegacyComponentType

Source

MagicLinkFormProps

Signature

declare const MagicLinkFormProps: MagicLinkFormProps

Source

MagicLinkLabels

Signature

declare const MagicLinkLabels: MagicLinkLabels

Source

PasswordResetConfirmForm

Signature

declare const PasswordResetConfirmForm: LegacyComponentType

Source

PasswordResetConfirmFormProps

Signature

declare const PasswordResetConfirmFormProps: PasswordResetConfirmFormProps

Source

PasswordResetConfirmLabels

Signature

declare const PasswordResetConfirmLabels: PasswordResetConfirmLabels

Source

PasswordResetRequestForm

Signature

declare const PasswordResetRequestForm: LegacyComponentType

Source

PasswordResetRequestFormProps

Signature

declare const PasswordResetRequestFormProps: PasswordResetRequestFormProps

Source

PasswordResetRequestLabels

Signature

declare const PasswordResetRequestLabels: PasswordResetRequestLabels

Source

Readable (interface)

Svelte’s readable-store contract.

Signature

export interface Readable<T> {
  readonly subscribe: (run: (value: T) => void) => () => void
}

Source

SecondFactorChallenge

Signature

declare const SecondFactorChallenge: { readonly token: string; readonly expiresAt: number }

Source

SendCaptchaProps

Signature

declare const SendCaptchaProps: SendCaptchaProps

Source

SignInForm

Signature

declare const SignInForm: LegacyComponentType

Source

SignInFormProps

Signature

declare const SignInFormProps: SignInFormProps

Source

SignInLabels

Signature

declare const SignInLabels: SignInLabels

Source

SignUpForm

Signature

declare const SignUpForm: LegacyComponentType

Source

SignUpFormProps

Signature

declare const SignUpFormProps: SignUpFormProps

Source

SignUpLabels

Signature

declare const SignUpLabels: SignUpLabels

Source

StatusResponse

Signature

declare const StatusResponse: { readonly status: boolean }

Source

atomStore

An Atom as a Svelte readable store over registry. Subscribing mounts the Atom and calls run at once with its value, then on every change; unsubscribing unmounts it. No state is held here: the registry is the store.

Signature

declare const atomStore: <A>(registry: AtomRegistry.AtomRegistry, atom: Atom.Atom<A>) => Readable<A>

Source

authClientKey

Signature

declare const authClientKey: symbol

Source

getAuthClient

Signature

declare const getAuthClient: () => AuthClient

Source

listSessionsStore

The signed-in user’s sessions as a readable store: atoms.sessionsState through atomStore. The first subscription starts the read, a session change refetches it through the Atom graph, and refetch() refreshes it.

Signature

declare const listSessionsStore: (registry: AtomRegistry.AtomRegistry, atoms: SessionAtoms) => ListSessionsStore

Source

sessionStore

The session as a readable store: atoms.state through atomStore. The first subscription starts the session read; session-changing calls on the client refetch it while it is subscribed.

Signature

declare const sessionStore: (registry: AtomRegistry.AtomRegistry, atoms: SessionAtoms) => Readable<SessionState>

Source

setAuthClient

Signature

declare const setAuthClient: (client: AuthClient) => AuthClient

Source


This site uses Just the Docs, a documentation theme for Jekyll.