# `RevenueCat`
[🔗](https://github.com/metacircu1ar/revenue_cat/blob/main/lib/revenue_cat.ex#L1)

RevenueCat V2 API client focused on entitlement checks and customer deletion.

Supports global config, per-call overrides, and reusable client structs.

# `option_key`

```elixir
@type option_key() :: :secret_api_key | :project_id | :base_url | :req_options
```

# `options`

```elixir
@type options() :: [{option_key(), term()}]
```

# `t`

```elixir
@type t() :: %RevenueCat{
  base_url: String.t(),
  project_id: nil | String.t(),
  req_options: keyword(),
  secret_api_key: nil | String.t()
}
```

# `delete_customer`

Deletes a customer in RevenueCat.

Returns `:ok` when RevenueCat responds with `200`, `204`, or `404`.

# `delete_customer`

```elixir
@spec delete_customer(String.t(), options()) :: :ok | {:error, term()}
@spec delete_customer(t(), String.t()) :: :ok | {:error, term()}
```

Deletes a customer using per-call options.

Options override app config for this call.

# `has_active_entitlement`

Checks whether a customer currently has an active entitlement.

`configured_entitlement` may be an entitlement ID, lookup key, or display name.
Returns `{:ok, true | false}` on successful API resolution.

# `has_active_entitlement`

```elixir
@spec has_active_entitlement(String.t(), String.t(), options()) ::
  {:ok, boolean()} | {:error, term()}
@spec has_active_entitlement(t(), String.t(), String.t()) ::
  {:ok, boolean()} | {:error, term()}
```

Checks active entitlement using per-call options.

Options override app config for this call.

# `new`

```elixir
@spec new(options()) :: t()
```

Builds a reusable client struct.

Options:

- `:secret_api_key`
- `:project_id`
- `:base_url` (defaults to RevenueCat V2 API base URL)
- `:req_options` (passed through to `Req.get/2` and `Req.delete/2`)

---

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