diff --git a/config/segment.php b/config/segment.php index 1e4e1f3..2b48de1 100644 --- a/config/segment.php +++ b/config/segment.php @@ -26,4 +26,18 @@ 'write_key' => '', + /* + |-------------------------------------------------------------------------- + | Segment Init Options + |-------------------------------------------------------------------------- + | + | This option specifies an array of options to initialize Segment. + | + | See: https://segment.com/docs/sources/server/php/#configuration. + | + | Default: [] + | + */ + + 'init_options' => [], ]; diff --git a/src/SegmentServiceProvider.php b/src/SegmentServiceProvider.php index 5791264..8a53e20 100644 --- a/src/SegmentServiceProvider.php +++ b/src/SegmentServiceProvider.php @@ -35,7 +35,7 @@ public function boot() $this->setupConfig(); if ($writeKey = $this->app->config->get('segment.write_key')) { - Segment::init($writeKey); + Segment::init($writeKey, (array) $this->app->config->get('segment.init_options')); } }