# `PostHog.Supervisor`
[🔗](https://github.com/posthog/posthog-elixir/blob/v2.18.0/lib/posthog/supervisor.ex#L1)

Supervisor that manages the processes required for PostHog event capture.

By default, `PostHog` starts this supervisor automatically from the `:posthog`
application configuration. Start it yourself when you need a custom supervision
tree or multiple PostHog instances.

# `child_spec`

```elixir
@spec child_spec(PostHog.Config.config()) :: Supervisor.child_spec()
```

Returns a child specification for a PostHog supervision tree.

## Parameters

- `config` - validated `t:PostHog.Config.config/0` for the instance.

## Returns

A `t:Supervisor.child_spec/0` that can be included in your application's
children list.

# `start_link`

```elixir
@spec start_link(PostHog.Config.config()) :: Supervisor.on_start()
```

Starts a PostHog supervision tree from a validated config.

## Parameters

- `config` - validated `t:PostHog.Config.config/0`. Use
  `PostHog.Config.validate!/1` before calling this function with raw options.

## Returns

Returns the standard `t:Supervisor.on_start/0` tuple.

---

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