diff --git a/composer.json b/composer.json
index 20d7f1b..83df1c2 100644
--- a/composer.json
+++ b/composer.json
@@ -12,8 +12,8 @@
     },
     "require": {
         "php": "^8.1",
-        "drupal/core": "^10.2.2 || ^11",
-        "pusher/pusher-php-server": "^7.2"
+        "pusher/pusher-php-server": "^7.2",
+        "drupal/core": "^10.2.2 || ^11 || ^12"
     },
     "config": {
         "allow-plugins": {
diff --git a/pusher_api.info.yml b/pusher_api.info.yml
index 120f644..98433b4 100644
--- a/pusher_api.info.yml
+++ b/pusher_api.info.yml
@@ -2,5 +2,5 @@ name: 'Pusher API'
 type: module
 description: 'Integration between Drupal and pusher.com'
 php: ^8.1
-core_version_requirement: ^10.2 || ^11
+core_version_requirement: ^10.2 || ^11 || ^12
 package: 'Web services'
diff --git a/pusher_api.install b/pusher_api.install
index 2836919..491dc3c 100644
--- a/pusher_api.install
+++ b/pusher_api.install
@@ -5,6 +5,8 @@
  * Installer for the pusher_api module.
  */
 
+use Drupal\Component\Utility\DeprecationHelper;
+use Drupal\Core\Extension\Requirement\RequirementSeverity;
 use Drupal\Core\Hook\Attribute\LegacyRequirementsHook;
 use Drupal\Core\Site\Settings;
 
@@ -22,7 +24,7 @@ function pusher_api_requirements($phase) {
       $requirements['pusher_api_settings'] = [
         'title' => t('Pusher API Settings'),
         'description' => t('Pusher API settings not found, please check the README.md for configuration information.'),
-        'severity' => REQUIREMENT_ERROR,
+        'severity' => DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.2.0', fn() => RequirementSeverity::Error, fn() => REQUIREMENT_ERROR),
       ];
     }
   }
diff --git a/pusher_api.module b/pusher_api.module
index 06a64a9..277f926 100644
--- a/pusher_api.module
+++ b/pusher_api.module
@@ -5,21 +5,13 @@
  * Module file for pusher_api module.
  */
 
-use Drupal\pusher_api\Factory\ConfigFactory;
+use Drupal\Core\Hook\Attribute\LegacyHook;
+use Drupal\pusher_api\Hook\PusherApiHooks;
 
 /**
  * Implements hook_page_attachments().
  */
+#[LegacyHook]
 function pusher_api_page_attachments(array &$attachments) {
-  /** @var \Drupal\pusher_api\Factory\ConfigFactory $configFactory */
-  $configFactory = \Drupal::service(ConfigFactory::class);
-  $defaultConfig = $configFactory->create();
-
-  $attachments['#attached']['drupalSettings']['pusherApi'] = [
-    'key' => $defaultConfig->key,
-    'cluster' => $defaultConfig->options['cluster'],
-    'authEndpoint' => '/admin/pusher-api/authentication',
-    'csrfToken' => '',
-  ];
-  $attachments['#attached']['library'][] = 'pusher_api/api';
+  \Drupal::service(PusherApiHooks::class)->pageAttachments($attachments);
 }
diff --git a/pusher_api.services.yml b/pusher_api.services.yml
index dc7ad3f..69d770e 100644
--- a/pusher_api.services.yml
+++ b/pusher_api.services.yml
@@ -33,3 +33,7 @@ services:
     class: 'Drupal\pusher_api\EventSubscriber\TriggerEventSubscriber'
     tags:
       - { name: event_subscriber }
+
+  Drupal\pusher_api\Hook\PusherApiHooks:
+    class: Drupal\pusher_api\Hook\PusherApiHooks
+    autowire: true
diff --git a/src/Hook/PusherApiHooks.php b/src/Hook/PusherApiHooks.php
new file mode 100644
index 0000000..10b59bc
--- /dev/null
+++ b/src/Hook/PusherApiHooks.php
@@ -0,0 +1,30 @@
+<?php
+
+namespace Drupal\pusher_api\Hook;
+
+use Drupal\pusher_api\Factory\ConfigFactory;
+use Drupal\Core\Hook\Attribute\Hook;
+
+/**
+ * Hook implementations for pusher_api.
+ */
+class PusherApiHooks {
+
+  /**
+   * Implements hook_page_attachments().
+   */
+  #[Hook('page_attachments')]
+  public static function pageAttachments(array &$attachments) {
+    /** @var \Drupal\pusher_api\Factory\ConfigFactory $configFactory */
+    $configFactory = \Drupal::service(ConfigFactory::class);
+    $defaultConfig = $configFactory->create();
+    $attachments['#attached']['drupalSettings']['pusherApi'] = [
+      'key' => $defaultConfig->key,
+      'cluster' => $defaultConfig->options['cluster'],
+      'authEndpoint' => '/admin/pusher-api/authentication',
+      'csrfToken' => '',
+    ];
+    $attachments['#attached']['library'][] = 'pusher_api/api';
+  }
+
+}
