NAME

Sentry::Options - The validated options of a client

SYNOPSIS

my $options = Sentry::SDK->get_client->get_options;
my $release = $options->{release};

DESCRIPTION

The options of "init" in Sentry::SDK as the client uses them: validated, with defaults filled in and SENTRY_* environment variables applied. The options are documented in "init" in Sentry::SDK.

The object is a hash reference holding every option, undef if unset. It is immutable: changing a value dies, and so does reading an option that does not exist, so a misspelled name is noticed instead of reading as unset. Lists and hashes in it are shared, not copied: leave them alone.

INTERNAL METHODS

Used by the SDK; not part of the public API, may change without notice.

new

my $options = Sentry::Options->new(\%options);

Validates the options: an invalid value is replaced by the default with a warning, an unknown option is dropped with a warning (once per process and name).

with

my $changed = $options->with({ before_send => $callback });

A copy with the given options changed; only those are validated.

for_init

my $options = Sentry::Options->for_init(\%given);

The options given to "init" in Sentry::SDK with the forced ones (see "force") and the SENTRY_* environment variables applied; warns about invalid environment variables.

force, with_forced, last_given

Sentry::Options->force({ transport => $transport });
my $options = Sentry::Options->with_forced(\%options);
Sentry::SDK->init(Sentry::Options->last_given);

Options that win over those given to every later init or callback update, for Sentry::Test; the given options with them applied; and the options given to the last init (before forcing).

callback_names, default, with_env, report_invalid_env

The names of the callback options, the default of an option, the options with the SENTRY_* environment variables applied, and warnings about invalid ones.