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>
AuthFormClasses
Signature
declare const AuthFormClasses: AuthFormClasses
AuthSuccess
Signature
declare const AuthSuccess: AuthResult
EmailOtpForm
Signature
declare const EmailOtpForm: LegacyComponentType
EmailOtpFormProps
Signature
declare const EmailOtpFormProps: EmailOtpFormProps
EmailOtpLabels
Signature
declare const EmailOtpLabels: EmailOtpLabels
EmailOtpPurpose
Signature
declare const EmailOtpPurpose: "sign-in" | "email-verification" | "forget-password"
FormFailure
Signature
declare const FormFailure: FormFailure
ListSessionsState (type alias)
The state listSessionsStore emits.
Signature
type ListSessionsState = SessionListState
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
}
MagicLinkForm
Signature
declare const MagicLinkForm: LegacyComponentType
MagicLinkFormProps
Signature
declare const MagicLinkFormProps: MagicLinkFormProps
MagicLinkLabels
Signature
declare const MagicLinkLabels: MagicLinkLabels
PasswordResetConfirmForm
Signature
declare const PasswordResetConfirmForm: LegacyComponentType
PasswordResetConfirmFormProps
Signature
declare const PasswordResetConfirmFormProps: PasswordResetConfirmFormProps
PasswordResetConfirmLabels
Signature
declare const PasswordResetConfirmLabels: PasswordResetConfirmLabels
PasswordResetRequestForm
Signature
declare const PasswordResetRequestForm: LegacyComponentType
PasswordResetRequestFormProps
Signature
declare const PasswordResetRequestFormProps: PasswordResetRequestFormProps
PasswordResetRequestLabels
Signature
declare const PasswordResetRequestLabels: PasswordResetRequestLabels
Readable (interface)
Svelte’s readable-store contract.
Signature
export interface Readable<T> {
readonly subscribe: (run: (value: T) => void) => () => void
}
SecondFactorChallenge
Signature
declare const SecondFactorChallenge: { readonly token: string; readonly expiresAt: number }
SendCaptchaProps
Signature
declare const SendCaptchaProps: SendCaptchaProps
SignInForm
Signature
declare const SignInForm: LegacyComponentType
SignInFormProps
Signature
declare const SignInFormProps: SignInFormProps
SignInLabels
Signature
declare const SignInLabels: SignInLabels
SignUpForm
Signature
declare const SignUpForm: LegacyComponentType
SignUpFormProps
Signature
declare const SignUpFormProps: SignUpFormProps
SignUpLabels
Signature
declare const SignUpLabels: SignUpLabels
StatusResponse
Signature
declare const StatusResponse: { readonly status: boolean }
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>
authClientKey
Signature
declare const authClientKey: symbol
getAuthClient
Signature
declare const getAuthClient: () => AuthClient
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
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>
setAuthClient
Signature
declare const setAuthClient: (client: AuthClient) => AuthClient