diff --git a/hooks.php b/hooks.php
index <HASH>..<HASH> 100644
--- a/hooks.php
+++ b/hooks.php
@@ -345,6 +345,12 @@ add_filter( 'init', [ '\Pressbooks\BookDirectory', 'init' ], 10, 2 );
 // -------------------------------------------------------------------------------------------------------------------
 // Sentry initializer - Only for staging and production environments
 // -------------------------------------------------------------------------------------------------------------------
-if ( defined( 'WP_ENV' ) && WP_ENV !== 'development' ) {
+if (
+	defined( 'WP_ENV' ) &&
+	WP_ENV !== 'development' &&
+	defined( 'SENTRY_KEY' ) &&
+	defined( 'SENTRY_ORGANIZATION' ) &&
+	defined( 'SENTRY_PROJECT' )
+) {
 	add_action( 'init', '\Pressbooks\Utility\initialize_sentry', 9999 );
 }
Add Sentry action only if env variables are defined