PHPackages                             as-cornell/as\_webhook\_update - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. as-cornell/as\_webhook\_update

ActiveDrupal-custom-module[Utility &amp; Helpers](/categories/utility)

as-cornell/as\_webhook\_update
==============================

Provides a webhook notification service tied into hook\_post\_action, used to generate remote nodes and terms.

v2.0.1(2mo ago)0554↓50%GPL-3.0-or-laterPHP

Since Oct 15Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/as-cornell/as_webhook_update)[ Packagist](https://packagist.org/packages/as-cornell/as_webhook_update)[ Docs](https://communications.as.cornell.edu)[ RSS](/packages/as-cornell-as-webhook-update/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)DependenciesVersions (13)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/2de556a0545f805ffe48ac1d58591fcc95fb586a6ac39dc81b19843b8cb6272a/68747470733a2f2f706f7365722e707567782e6f72672f61732d636f726e656c6c2f61735f776562686f6f6b5f7570646174652f76)](https://packagist.org/packages/as-cornell/as_webhook_update)

AS WEBHOOK UPDATE (as\_webhook\_update)
=======================================

[](#as-webhook-update-as_webhook_update)

INTRODUCTION
------------

[](#introduction)

[![Takeoff](https://camo.githubusercontent.com/425f7cfe712786ff3cd35837c05adfa3a1f83631a48660650853195c34d7b517/68747470733a2f2f6d65646961302e67697068792e636f6d2f6d656469612f76312e59326c6b505463354d4749334e6a4578623341346558566a5a47706e636e517965446c6e647a49325a576479636a5a7564486c75634778754f4756684d544e745a5777774d435a6c634431324d563970626e526c636d35686246396e61575a66596e6c666157516d593351395a772f5359576e52785637675331783857546a6f362f67697068792e676966 "send it")](https://camo.githubusercontent.com/425f7cfe712786ff3cd35837c05adfa3a1f83631a48660650853195c34d7b517/68747470733a2f2f6d65646961302e67697068792e636f6d2f6d656469612f76312e59326c6b505463354d4749334e6a4578623341346558566a5a47706e636e517965446c6e647a49325a576479636a5a7564486c75634778754f4756684d544e745a5777774d435a6c634431324d563970626e526c636d35686246396e61575a66596e6c666157516d593351395a772f5359576e52785637675331783857546a6f362f67697068792e676966)

Provides a webhook notification service that sends entity changes (articles, people, taxonomy terms) to remote systems via HTTP webhooks. Uses an OOP architecture with services, extractors, and dependency injection for maintainability and testability.

REQUIREMENTS
------------

[](#requirements)

### Required Modules

[](#required-modules)

- `drupal/hook_post_action` - Provides post-action hooks for entity operations
- `drupal/key` - Provides secure storage for the authorization token

### System Requirements

[](#system-requirements)

- Drupal 9.5+ or Drupal 10+
- PHP 8.0+

INSTALLATION
------------

[](#installation)

### New Installation

[](#new-installation)

1. **Install dependencies:**

    ```
    composer require drupal/hook_post_action drupal/key
    ```
2. **Enable the modules:**

    ```
    drush en hook_post_action key as_webhook_update -y
    ```
3. **Configure the authorization token:**

    - Navigate to `/admin/config/services/webhook-update`
    - Enter your authorization token
    - Click "Save Configuration"

    The token is securely stored using the Key module and will not be exported with configuration.
4. **Verify the configuration:**

    ```
    drush config:get as_webhook_update.domain_config
    ```

### Upgrading from Previous Version

[](#upgrading-from-previous-version)

**IMPORTANT:** If you're upgrading from the procedural version to the OOP version, you must manually import the domain configuration. You will need to set up the relationship between domains as fits your use case:

1. **Clear cache:**

    ```
    drush cr
    ```
2. **Import domain configuration:**

    ```
    drush config:import --partial --source=modules/custom/as_webhook_update/config/install -y
    ```

    Or if using Lando:

    ```
    lando drush config:import --partial --source=/app/web/modules/custom/as_webhook_update/config/install -y
    ```

    Or if on Pantheon (adapt pattern as appropriate):

    ```
    terminus remote:drush artsci-as.dev -- config:import --partial --source=modules/custom/as_webhook_update/config/install -y
    terminus remote:drush artsci-people.dev -- config:import --partial --source=modules/custom/as_webhook_update/config/install -y
    terminus remote:drush artsci-as.test -- config:import --partial --source=modules/custom/as_webhook_update/config/install -y
    terminus remote:drush artsci-people.test -- config:import --partial --source=modules/custom/as_webhook_update/config/install -y
    terminus remote:drush artsci-as.live -- config:import --partial --source=modules/custom/as_webhook_update/config/install -y
    terminus remote:drush artsci-people.live -- config:import --partial --source=modules/custom/as_webhook_update/config/install -y
    ```
3. **Verify the config was imported:**

    ```
    drush config:get as_webhook_update.domain_config
    ```

    You should see environment-specific webhook URLs.
4. **Migrate the authorization token** (if you had one configured):

    ```
    # Get the old token value
    drush cget as_webhook_update.settings token

    # Set it via the new form at /admin/config/services/webhook-update
    # Or via drush:
    drush php-eval "
    \$key = \Drupal\key\Entity\Key::create([
      'id' => 'as_webhook_update_token',
      'label' => 'Webhook Update Authorization Token',
      'key_type' => 'authentication',
      'key_provider' => 'config',
      'key_provider_settings' => ['key_value' => 'YOUR_TOKEN_HERE'],
    ]);
    \$key->save();
    "
    ```
5. **Test the webhooks:**

    - Update an article, person, or taxonomy term
    - Check logs: `drush watchdog:show --type=as_webhook_update`

CONFIGURATION
-------------

[](#configuration)

### Authorization Token

[](#authorization-token)

The webhook authorization token is stored securely via the **Key module** and is NOT exported with configuration:

- **Configure via UI:** `/admin/config/services/webhook-update`
- **Configure via Drush:** See installation instructions above
- **Documentation:** See `KEY_SETUP.md` for detailed setup instructions

### Webhook Destinations

[](#webhook-destinations)

Webhook URLs are configured in `config/install/as_webhook_update.domain_config.yml` and are environment-specific:

- **Local (Lando):** `artsci-*.lndo.site`
- **Dev/Test (Pantheon):** `*-artsci-*.pantheonsite.io`
- **Production:** `*.as.cornell.edu`

The module automatically determines the correct webhook URLs based on the current domain.

ARCHITECTURE
------------

[](#architecture)

### OOP Design (v2.0+)

[](#oop-design-v20)

The module uses a service-based architecture with dependency injection:

```
as_webhook_update/
├── src/
│   ├── Service/
│   │   ├── WebhookDispatcherService.php      - Main orchestrator
│   │   ├── HttpClientService.php              - HTTP/cURL handling
│   │   ├── DestinationResolverService.php     - URL resolution
│   │   └── PersonTypeRoutingService.php       - Person routing logic
│   ├── DataExtractor/
│   │   ├── EntityDataExtractorInterface.php   - Common interface
│   │   ├── ArticleDataExtractor.php           - Article data
│   │   ├── PersonDataExtractor.php            - Person data
│   │   ├── MediaReportPersonDataExtractor.php - Simplified person data
│   │   └── TaxonomyTermDataExtractor.php      - Taxonomy data
│   ├── Factory/
│   │   └── EntityExtractorFactory.php         - Extractor selection
│   └── ValueObject/
│       └── WebhookDestination.php             - Destination VO

```

### Hooks

[](#hooks)

The module implements Drupal hooks that delegate to the dispatcher service:

- `hook_ENTITY_TYPE_postinsert()` - For nodes and taxonomy terms
- `hook_ENTITY_TYPE_postupdate()` - For nodes and taxonomy terms
- `hook_ENTITY_TYPE_postdelete()` - For nodes

### Supported Entities

[](#supported-entities)

- **Article nodes** - Sent to articles webhook
- **Person nodes** - Sent to AS, department, and/or media report webhooks based on person type
- **Taxonomy terms** - `academic_interests`, `academic_role`, `research_areas`

MAINTAINERS
-----------

[](#maintainers)

Current maintainers for Drupal 10:

- Mark Wilson (markewilson)

DOCUMENTATION
-------------

[](#documentation)

- **REFACTORING.md** - Details about the OOP refactoring
- **KEY\_SETUP.md** - Complete guide to setting up the authorization token
- **as\_webhook\_update.services.yml** - Service definitions

TROUBLESHOOTING
---------------

[](#troubleshooting)

### No webhooks being sent

[](#no-webhooks-being-sent)

1. **Check if domain config is imported:**

    ```
    drush config:get as_webhook_update.domain_config
    ```

    If it returns "Config does not exist", import it:

    ```
    drush config:import --partial --source=modules/custom/as_webhook_update/config/install -y
    ```
2. **Check if authorization token is configured:**

    ```
    drush php-eval "\$key = \Drupal::service('key.repository')->getKey('as_webhook_update_token'); echo \$key ? 'Token configured' : 'Token NOT configured';"
    ```
3. **Check the logs:**

    ```
    drush watchdog:show --type=as_webhook_update --count=10
    ```
4. **Verify the dispatcher service exists:**

    ```
    drush php-eval "echo get_class(\Drupal::service('as_webhook_update.dispatcher'));"
    ```

### HTTP code 0 errors

[](#http-code-0-errors)

If webhooks show "HTTP code 0", the destination server is unreachable:

- Verify the destination server is running
- Check network connectivity
- Verify the webhook listener endpoint exists

### Testing webhooks

[](#testing-webhooks)

```
# Manually trigger a webhook
drush php-eval "
\$node = \Drupal::entityTypeManager()->getStorage('node')->load(NODE_ID);
\Drupal::service('as_webhook_update.dispatcher')->dispatch(\$node, 'update');
"

# Monitor logs in real-time
drush watchdog:tail --type=as_webhook_update
```

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance85

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~45 days

Recently: every ~81 days

Total

12

Last Release

76d ago

Major Versions

v1.0.9 → v2.0.02026-03-02

### Community

Maintainers

![](https://www.gravatar.com/avatar/f17dcdbbef5d086a5058ec138bc2f825149a5711e83709868f43494eef805b51?d=identicon)[markewilson](/maintainers/markewilson)

---

Top Contributors

[![markewilson](https://avatars.githubusercontent.com/u/7050965?v=4)](https://github.com/markewilson "markewilson (44 commits)")

### Embed Badge

![Health badge](/badges/as-cornell-as-webhook-update/health.svg)

```
[![Health](https://phpackages.com/badges/as-cornell-as-webhook-update/health.svg)](https://phpackages.com/packages/as-cornell-as-webhook-update)
```

###  Alternatives

[vinicius73/seotools

A package containing SEO helpers.

245.2k](/packages/vinicius73-seotools)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
