# `PhoenixKit.Install.PrefixConfig`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v2.13.7/lib/phoenix_kit/install/prefix_config.ex#L1)

Persists the `--prefix` install option into the host's config files.

`mix phoenix_kit.install --prefix "auth"` bakes the prefix into the
generated migration, but the migration docs also tell hosts to set

    config :phoenix_kit, prefix: "auth"

Without that config entry, later tooling (`mix phoenix_kit.update`,
`mix phoenix_kit.status`) defaults to `"public"`, reports the install
as missing, and — worst case — generates a from-scratch migration
into the wrong schema. This module writes the config entry whenever
a non-public prefix is used, mirroring how the repo config is added.

# `add_prefix_configuration`

```elixir
@spec add_prefix_configuration(term(), String.t() | nil) :: term()
```

Adds `config :phoenix_kit, prefix: prefix` to config.exs and test.exs
when installing with a non-public prefix. No-op for the default
`"public"` prefix (or when no prefix option was given).

# `resolve_prefix`

```elixir
@spec resolve_prefix(keyword() | map()) :: String.t()
```

Resolves the effective schema prefix for phoenix_kit mix tasks.

Order: explicit `--prefix` option → `config :phoenix_kit, :prefix` →
`"public"`. Raises `ArgumentError` for a prefix the migration chain
would reject anyway (empty string, uppercase, dashes, injection
shapes) — failing at the task boundary beats failing mid-migration.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
