# `LatticeStripe.Config`
[🔗](https://github.com/szTheory/lattice_stripe/blob/v2.2.2/lib/lattice_stripe/config.ex#L1)

Client configuration schema and validation.

Uses NimbleOptions to validate all client options at creation time,
providing clear error messages for invalid configuration.

## Required Options

- `:api_key` - Your Stripe API key (`sk_test_...` or `sk_live_...`)

## Optional Options

- `:finch` - Name of the Finch pool for HTTP requests. Defaults to
  `LatticeStripe.Finch`, started automatically at application boot unless
  disabled via `config :lattice_stripe, start_default_finch: false`. Pass your
  own pool name to override.

See `schema/0` for full option documentation with defaults.

## Example

    # Zero-config: the default LatticeStripe.Finch pool is started for you.
    {:ok, config} = LatticeStripe.Config.validate(api_key: "sk_test_...")

    # Or bring your own pool. In your application supervisor:
    children = [
      {Finch, name: MyApp.Finch}
    ]

    # Then pass it explicitly to override the default:
    {:ok, config} = LatticeStripe.Config.validate(
      api_key: "sk_test_...",
      finch: MyApp.Finch
    )

# `schema`

Returns the NimbleOptions schema used for validation.

# `validate`

Validates the given options against the config schema.

Returns `{:ok, validated_opts}` on success or `{:error, %NimbleOptions.ValidationError{}}`
on failure.

# `validate!`

Validates the given options against the config schema, raising on failure.

Returns the validated keyword list on success, or raises
`NimbleOptions.ValidationError` with a descriptive message on failure.

---

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