PHPackages                             automattic/jetpack-shared-extension-utils - 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. automattic/jetpack-shared-extension-utils

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

automattic/jetpack-shared-extension-utils
=========================================

Utility functions used by the block editor extensions

v1.5.8(4w ago)3791GPL-2.0-or-laterJavaScriptCI failing

Since Feb 9Pushed 1mo ago3 watchersCompare

[ Source](https://github.com/Automattic/jetpack-shared-extension-utils)[ Packagist](https://packagist.org/packages/automattic/jetpack-shared-extension-utils)[ RSS](/packages/automattic-jetpack-shared-extension-utils/feed)WikiDiscussions trunk Synced 4w ago

READMEChangelogDependencies (4)Versions (216)Used By (0)

Shared Extension Utilities
==========================

[](#shared-extension-utilities)

Utility functions used by the block editor extensions.

This package is the new home for the code in [the `extensions/shared`directory](https://github.com/Automattic/jetpack/tree/trunk/projects/plugins/jetpack/extensions/shared)of the Jetpack plugin, so that plugins can share it. To begin with, we moving the code used by the Publicize editor extension, but the goal is to bring over all the shared code.

Fetching modules data from the store
------------------------------------

[](#fetching-modules-data-from-the-store)

The package relies on [controls](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-data/#controls)and [resolvers](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-data/#resolvers)to pull modules data from the API, and put it into the package's Redux store.

### Basic Usage

[](#basic-usage)

In order to have all modules related data synced within different packages, let's use this Redux store as a source of truth, for both, getting and updating the data.

Use [`withSelect`](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-data/#withselect), `withDispatch` higher-order component to pull the data or [`useSelect`](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-data/#useselect) hook to pull the data from the store to pull directly in component. Example:

```
// Imports.
import { withSelect, withDispatch } from '@wordpress/data';
import { JETPACK_MODULES_STORE_ID } from '@automattic/jetpack-shared-extension-utils';

const SampleComponent = props => {
	const { isModuleActive, isLoadingModules, isChangingStatus, updateJetpackModuleStatus } = props;

    if ( isModuleActive ) {
        return Module is active;
    }

    if ( isLoadingModules ) {
        return Loading modules...;
    }

    if ( !isModuleActive ) {
        return  updateJetpackModuleStatus( 'contact-form', true ) }>
            Activate module
        ;
    }

	return Active contact form module;
}

// We wrap `SampleComponent` into the composition of `withSelect` and `withDispatch` HOCs,
// which will pull the data from the store and pass as a parameter into the component.
// Jetpack modules will be pulled after first selection `isModuleActive`.
export default compose( [
	withSelect( ( select, props ) => {
		const { isModuleActive, areModulesLoading, isModuleUpdating } = select( 'jetpack-modules' );
		return {
			isModuleActive: isModuleActive( 'contact-form' ),
			isLoadingModules: areModulesLoading(),
			isChangingStatus: isModuleUpdating( 'contact-form' ),
		};
	} ),
	withDispatch( dispatch => {
		const { updateJetpackModuleStatus } = dispatch( 'jetpack-modules' );
		return { updateJetpackModuleStatus };
	} ),
] )( ( SampleComponent ) );
```

How to install shared-extension-utils
-------------------------------------

[](#how-to-install-shared-extension-utils)

### Installation From Git Repo

[](#installation-from-git-repo)

Contribute
----------

[](#contribute)

Get Help
--------

[](#get-help)

Security
--------

[](#security)

Need to report a security vulnerability? Go to  or directly to our security bug bounty site .

License
-------

[](#license)

shared-extension-utils is licensed under [GNU General Public License v2 (or later)](./LICENSE.txt)

###  Health Score

53

—

FairBetter than 96% of packages

Maintenance99

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community25

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor3

3 contributors hold 50%+ of commits

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 ~7 days

Total

212

Last Release

29d ago

Major Versions

v0.20.3 → v1.0.02025-06-03

### Community

Maintainers

![](https://www.gravatar.com/avatar/7c5869ecbb8e0eac7e8b8e0f3cf7bdd8d5fcdc4abc10a72281872c53f8639d44?d=identicon)[automattic](/maintainers/automattic)

![](https://www.gravatar.com/avatar/11609890f6e7a840715f4cfc9622d77ea64b7dfc024df5643fbf8471a18c00f3?d=identicon)[kraft](/maintainers/kraft)

![](https://www.gravatar.com/avatar/5326730499ec14e274f51b9bcc39db6aac0fb38b33849715aae0e2587a2b93df?d=identicon)[jeherve](/maintainers/jeherve)

![](https://www.gravatar.com/avatar/6e220e167e341c28b1aa10bf0bb0374999068329f8683d3187ee3cf6749b8837?d=identicon)[dereksmart](/maintainers/dereksmart)

---

Top Contributors

[![anomiex](https://avatars.githubusercontent.com/u/1030580?v=4)](https://github.com/anomiex "anomiex (250 commits)")[![tbradsha](https://avatars.githubusercontent.com/u/32492176?v=4)](https://github.com/tbradsha "tbradsha (89 commits)")[![manzoorwanijk](https://avatars.githubusercontent.com/u/18226415?v=4)](https://github.com/manzoorwanijk "manzoorwanijk (48 commits)")[![zinigor](https://avatars.githubusercontent.com/u/374293?v=4)](https://github.com/zinigor "zinigor (38 commits)")[![gmjuhasz](https://avatars.githubusercontent.com/u/36671565?v=4)](https://github.com/gmjuhasz "gmjuhasz (30 commits)")[![jeherve](https://avatars.githubusercontent.com/u/426388?v=4)](https://github.com/jeherve "jeherve (28 commits)")[![coder-karen](https://avatars.githubusercontent.com/u/16754605?v=4)](https://github.com/coder-karen "coder-karen (25 commits)")[![samiff](https://avatars.githubusercontent.com/u/15803018?v=4)](https://github.com/samiff "samiff (24 commits)")[![nateweller](https://avatars.githubusercontent.com/u/10933065?v=4)](https://github.com/nateweller "nateweller (17 commits)")[![kraftbj](https://avatars.githubusercontent.com/u/88897?v=4)](https://github.com/kraftbj "kraftbj (16 commits)")[![haqadn](https://avatars.githubusercontent.com/u/3737780?v=4)](https://github.com/haqadn "haqadn (15 commits)")[![ice9js](https://avatars.githubusercontent.com/u/8056203?v=4)](https://github.com/ice9js "ice9js (13 commits)")[![bindlegirl](https://avatars.githubusercontent.com/u/1242807?v=4)](https://github.com/bindlegirl "bindlegirl (13 commits)")[![sdixon194](https://avatars.githubusercontent.com/u/33553323?v=4)](https://github.com/sdixon194 "sdixon194 (11 commits)")[![dilirity](https://avatars.githubusercontent.com/u/11799079?v=4)](https://github.com/dilirity "dilirity (10 commits)")[![CGastrell](https://avatars.githubusercontent.com/u/157240?v=4)](https://github.com/CGastrell "CGastrell (9 commits)")[![sergeymitr](https://avatars.githubusercontent.com/u/1341249?v=4)](https://github.com/sergeymitr "sergeymitr (8 commits)")[![CodeyGuyDylan](https://avatars.githubusercontent.com/u/65001528?v=4)](https://github.com/CodeyGuyDylan "CodeyGuyDylan (6 commits)")[![elliottprogrammer](https://avatars.githubusercontent.com/u/11078128?v=4)](https://github.com/elliottprogrammer "elliottprogrammer (5 commits)")[![chihsuan](https://avatars.githubusercontent.com/u/4344253?v=4)](https://github.com/chihsuan "chihsuan (5 commits)")

### Embed Badge

![Health badge](/badges/automattic-jetpack-shared-extension-utils/health.svg)

```
[![Health](https://phpackages.com/badges/automattic-jetpack-shared-extension-utils/health.svg)](https://phpackages.com/packages/automattic-jetpack-shared-extension-utils)
```

###  Alternatives

[yavin/symfony-form-tree

create select field with indentation for tree structure

1591.1k1](/packages/yavin-symfony-form-tree)[spatie/laravel-help-space

Integrate Helpspace in your Laravel app

2333.7k](/packages/spatie-laravel-help-space)

PHPackages © 2026

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