Persistence behaviour for auth credentials and key-store datasets.
Phase 15 supports two built-in file backends:
BaileysEx.Auth.NativeFilePersistencefor the recommended durable Elixir-first ETF storageBaileysEx.Auth.FilePersistencefor the Baileys-compatible JSON multi-file helper kept as a migration/compatibility bridge from Baileys JS sidecars
Custom backends can implement either the context-free callbacks, the
context-aware callbacks, or both. BaileysEx.Auth.KeyStore dispatches to the
widest arity the backend exports.
Summary
Types
Helper map returned by the built-in auth-state loaders.
Types
@type auth_state_helper() :: %{ state: BaileysEx.Auth.State.t(), connect_opts: keyword(), save_creds: (BaileysEx.Auth.State.t() | map() -> :ok | {:error, term()}) }
Helper map returned by the built-in auth-state loaders.
connect_opts is ready to merge into BaileysEx.connect/2, and save_creds
persists the latest auth-state snapshot for the selected backend.
Callbacks
@callback load_credentials() :: {:ok, BaileysEx.Auth.State.t()} | {:error, term()}
@callback load_credentials(context :: term()) :: {:ok, BaileysEx.Auth.State.t()} | {:error, term()}
@callback save_credentials(BaileysEx.Auth.State.t()) :: :ok | {:error, term()}
@callback save_credentials(context :: term(), BaileysEx.Auth.State.t()) :: :ok | {:error, term()}