Catenis API Client for WordPress enables (JavaScript) code on WordPress pages to interact with the Catenis API.
To enable the Catenis API client for a given WordPress page, go to the page’s edit page and look for a section (meta box) named “Catenis API Client” below the page’s main editing panel. Make sure the section is expanded, and check the Load Catenis API Client checkbox.
You can then choose to override the global settings used for instantiating the Catenis API client on that given page, like using a different device ID and its associated API access secret. Otherwise, whatever is configured in the plugin’s global settings — configured under “Settings” | “Catenis API Client” — is going to be used.
Once enabled, a global JavaScript variable named ctnApiClient is made available on the page. That variable holds the instantiated Catenis API client object.
Use the ctnApiClient variable to call the Catenis API methods by invoking the corresponding method on that object.
For a reference of the available methods, please refer to the Catenis API JavaScript Client as it is functionally identical to the Catenis API Client for WordPress, except for notifications support and error handling.
The notification feature on Catenis API Client for WordPress is almost identical to the one found on the Catenis API JavaScript client. The two noticeable differences are:
Please refer to the “Receiving Notifications” section below for detailed information on how to receive Catenis notifications from within WordPress pages.
Errors that take place while calling the Catenis API methods are returned as standard JavaScript Error objects.
= Instantiate WebSocket notification channel object
Create a WebSocket notification channel for a given Catenis notification event.
var wsNotifyChannel = ctnApiClient.createWsNotifyChannel(eventName);
Add event listeners to monitor activity on the notification channel.
ctnApiClient.on('comm-error', function (error) { // Error communicating with Catenis notification process }); wsNotifyChannel.on('open', function (error) { if (error) { // Error establishing underlying WebSocket connection } else { // Notification channel successfully open } }); wsNotifyChannel.on('error', function (error) { // Error in the underlying WebSocket connection }); wsNotifyChannel.on('close', function (code, reason) { // Underlying WebSocket connection has been closed }); wsNotifyChannel.on('notify', function (eventData) { // Received notification });
Note: the ‘comm-error’ event is emitted by the Catenis API client object while all other events are emitted by the WebSocket notification channel object.
Open the WebSocket notification channel to start receiving notifications.
wsNotifyChannel.open(function (error) { if (err) { // Error sending command to open notification channel } });
Close the WebSocket notification channel to stop receiving notifications.
wsNotifyChannel.close(function (error) { if (err) { // Error sending command to close notification channel } });
Starting from $0 per month.
Rating
Reviewers
No reviews
Tags
Developed By
IronMan
Quick & Easy
Common Ninja has a large selection of powerful Wordpress plugins that are easy to use, fully customizable, mobile-friendly and rich with features — so be sure to check them out!
Testimonial plugins for Wordpress
Galleries plugins for Wordpress
SEO plugins for Wordpress
Contact Form plugins for Wordpress
Forms plugins for Wordpress
Social Feeds plugins for Wordpress
Social Sharing plugins for Wordpress
Events Calendar plugins for Wordpress
Sliders plugins for Wordpress
Analytics plugins for Wordpress
Reviews plugins for Wordpress
Comments plugins for Wordpress
Portfolio plugins for Wordpress
Maps plugins for Wordpress
Security plugins for Wordpress
Translation plugins for Wordpress
Ads plugins for Wordpress
Video Player plugins for Wordpress
Music Player plugins for Wordpress
Backup plugins for Wordpress
Privacy plugins for Wordpress
Optimize plugins for Wordpress
Chat plugins for Wordpress
Countdown plugins for Wordpress
Email Marketing plugins for Wordpress
Tabs plugins for Wordpress
Membership plugins for Wordpress
popup plugins for Wordpress
SiteMap plugins for Wordpress
Payment plugins for Wordpress
Coming Soon plugins for Wordpress
Ecommerce plugins for Wordpress
Customer Support plugins for Wordpress
Inventory plugins for Wordpress
Video Player plugins for Wordpress
Testimonials plugins for Wordpress
Tabs plugins for Wordpress
Social Sharing plugins for Wordpress
Social Feeds plugins for Wordpress
Slider plugins for Wordpress
Reviews plugins for Wordpress
Portfolio plugins for Wordpress
Membership plugins for Wordpress
Forms plugins for Wordpress
Events Calendar plugins for Wordpress
Contact plugins for Wordpress
Comments plugins for Wordpress
Analytics plugins for Wordpress
Common Ninja Apps
Browse our extensive collection of compatible plugins, and easily embed them on any website, blog, online store, e-commerce platform, or site builder.
Use Messenger Chat To Communicate, Support & Improve User Experience
Captivatingly Track Time Passed Since Your Memorable Event
Increase Trust & Improve Credibility To Drive Sales Up
Streamline Learning: Interactive, Customizable Definitions for Your Site
Create Impressive Vimeo Feeds & Improve User Experience
Effortless Mega Footer Creation for Modern Websites
Enhance Your Website Visually & Draw Attention to Stunning Videos
Captivate visitors with stunning animated titles effortlessly
Create Stunning RSS Feeds & Improve User Experience
Improve Navigation & Enhance Design
Empower Your Monetization by Detecting Ad Blockers
Display LinkedIn Posts in a Stylish and Engaging Slider
More plugins
The Common Ninja Search Engine platform helps website builders find the best site widgets, apps, plugins, tools, add-ons, and extensions! Compatible with all major website building platforms - big or small - and updated regularly, our Search Engine tool provides you with the business tools your site needs!