Skip to content

Public API Reference

Shadowfen edited this page Jul 29, 2026 · 5 revisions

This section documents the public API provided by LibSavedVars. The public API is the supported interface addon developers should use when creating, accessing, and managing saved variables.

Internal implementation functions and classes are not covered here and may change between library versions.

API Overview

LibSavedVars provides APIs for:

  • Creating account-wide saved variables.

  • Creating character-specific saved variables.

  • Managing defaults.

  • Handling version upgrades and migrations.

  • Switching between account-wide and character settings.

  • Pinning selected settings to account-wide storage.

  • Accessing raw saved variable data.

  • Iterating over active settings.


Creating Saved Variables

LibSavedVars:NewAccountWide()

Creates an account-wide saved variable object.

Syntax

local settings = LibSavedVars:NewAccountWide(
    savedVariableName,
    version,
    namespace,
    defaults
)

Parameters

Parameter | Type | Description -- | -- | -- savedVariableName | string | ESO SavedVariables table name. version | number | Current saved data version. namespace | string/nil | Optional namespace within the saved variables table. defaults | table | Default settings values.

This API provides the building blocks needed to manage simple settings as well as complex, evolving saved data structures.

Clone this wiki locally