Skip to content

wpsignal/wordsocket

Repository files navigation

WordSocket

The official WordPress plugin for WPSignal. WordSocket enables developers to connect their site to a secure WebSocket relay.

Install:

WP.org:

The easiest way is to download is wordpress.org/plugins/wordsocket.

WP CLI:

wp plugin install wordsocket --activate

Minimal example:

Create a trigger:

// Fire on any WordPress action hook
WPS::trigger( 'comment.posted' )
    ->on( 'wp_insert_comment', 10, 2 )
    ->channel( 'events' )
    ->data( fn( $id, $comment ) => [ 'author' => $comment->comment_author ] )
    ->register();

Listen and act on trigger when it fires:

type Comment = {
  // ...
};
// Handle it in the browser
const on = WPS.on( 'comment.posted', (comment: Comment) => {
    // Do cool things with the new `comment`
});

Documentation

Full documentation, API reference, and guides are at wpsignal.io/docs.

Changelog

Full changelog can be viewed in CHANGELOG.md

License

GPL-2.0-or-later

About

Sends realtime events from WordPress to browsers via api.wpsignal.io. Connects via WebSocket (SSE fallback) and exposes a public JS API for other plugins to share the connection. Also provider a WebSocket based provider for WordPress's Realtime Collaboration.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors