https://github.com/sr258/wp-h5p-shared-state
A companion microservice to WordPress that offers a shared state service for H5P
https://github.com/sr258/wp-h5p-shared-state
Last synced: about 1 year ago
JSON representation
A companion microservice to WordPress that offers a shared state service for H5P
- Host: GitHub
- URL: https://github.com/sr258/wp-h5p-shared-state
- Owner: sr258
- License: gpl-3.0
- Created: 2022-01-23T09:41:31.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-03-05T17:12:12.000Z (over 4 years ago)
- Last Synced: 2025-06-04T19:37:11.417Z (about 1 year ago)
- Language: TypeScript
- Size: 424 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# WordPress H5P Shared State Microservice
This is a microservice that runs alongside a WordPress installation and allows
content types to have a shared state.
## Requirements
- NodeJS >= 16
- NPM >= 7
## Installation
- Configure you service with environment variables or .env (see example.env)
- Start the service (`npm ci && npm run build && npm start`)
- Configure WordPress by adding a library configuration in `wp-config.php`
(change the hostnames according to your setup):
```php
define('H5P_LIBRARY_CONFIG', array(
"H5P.ShareDBTest" => array(
"serverUrl" => "ws://localhost:3000/shared-state",
"auth" => "http://localhost:3000/auth-data")
));
```
- Add this to `wp-config.php` to allow multiple uploads of the same library
version for testing purposes:
```php
define('H5P_DEV', true);
define('H5P_DISABLE_AGGREGATION', true);
```
- Start WordPress. Make sure you've set WORDPRESS_LOGGED_IN_KEY and
WORDPRESS_LOGGED_IN_SALT to the same value as used in this microservice!