Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@cocreate/socket-server

CoCreate-app77AGPL-3.01.31.1

CoCreate-socket-server

cocreate-socket, cocreate, low-code-framework, no-code-framework, cocreatejs, cocreatejs-component, cocreate-framework, no-code, low-code, collaborative-framework, realtime, realtime-framework, collaboration, shared-editing, html5-framework, javascript-framework

readme

CoCreate-socket-server

A simple socket-server component in vanilla javascript. Easily configured using HTML5 data-attributes and/or JavaScript API. Take it for a spin in our playground!

GitHub latest release GitHub contributors License Hiring

CoCreate

CoCreate Docs

We want this library to be community-driven, and CoCreate led. We need your help to realize this goal. To help make sure we are building the right things in the right order, we ask that you create issues and pull requests or merely upvote or comment on existing issues or pull requests.

We appreciate your continued support, thank you!

Table of Contents

Announcements

All updates to this library are documented in our CHANGELOG and releases. You may also subscribe to email for releases and breaking changes.

Roadmap

If you are interested in the future direction of this project, please take a look at our open issues and pull requests. We would love to hear your feedback.

About

CoCreate-socket-server is guided and supported by the CoCreate Developer Experience Team.

Please Email the Developer Experience Team here in case of any queries.

CoCreate-socket-server is maintained and funded by CoCreate. The names and logos for CoCreate are trademarks of CoCreate, LLC.

How to Contribute

We encourage contribution to our libraries (you might even score some nifty swag), please see our CONTRIBUTING guide for details.

License

This software is dual-licensed under the GNU Affero General Public License version 3 (AGPLv3) and a commercial license.

  • Open Source Use: For open-source projects and non-commercial use, this software is available under the AGPLv3. The AGPLv3 allows you to freely use, modify, and distribute this software, provided that all modifications and derivative works are also licensed under the AGPLv3. For the full license text, see the LICENSE file.

  • Commercial Use: For-profit companies and individuals intending to use this software for commercial purposes must obtain a commercial license. The commercial license is available when you sign up for an API key on our website. This license permits proprietary use and modification of the software without the copyleft requirements of the AGPLv3. It is ideal for integrating this software into proprietary commercial products and applications.

If you have not purchased a commercial license and intend to use this software for commercial purposes, you are required to sign up for an API key on our website.

changelog

1.31.1 (2025-05-01)

Bug Fixes

1.31.0 (2025-04-30)

Features

  • if data.endpoint emit "endpoint" (93c650d)

1.30.0 (2024-11-04)

Bug Fixes

  • prettier.config options (f9fedfa)

Features

  • add prettier.config.js and format files (e24bf77)

1.29.5 (2024-07-03)

Bug Fixes

  • handling of message_log (121ab98)

1.29.4 (2024-06-23)

Bug Fixes

1.29.3 (2024-06-23)

Bug Fixes

1.29.2 (2024-06-22)

Bug Fixes

  • temporarily handle sending messages that dont have modules (f1f6407)

1.29.1 (2024-04-26)

Bug Fixes

  • clearTimout if userid seesion is reconnected (4895fff)

1.29.0 (2024-03-18)

Features

  • get socket using socket.id to maintain a persitient socket connection wtih client tabs (922a462)

1.28.3 (2024-02-18)

Bug Fixes

1.28.2 (2024-02-15)

Bug Fixes

  • data.socket removal before sending (ed9b6a1)

1.28.1 (2024-02-05)

Bug Fixes

1.28.0 (2024-01-30)

Features

  • seperate onMessage from Message in order to to support internal message (231f2cc)

1.27.1 (2024-01-17)

Bug Fixes

  • handling of host and origin. Updated to support new query system (61a1c68)

1.27.0 (2024-01-08)

Bug Fixes

  • applied host to define environment/branch (fad44e5)

Features

  • bumped CoCreate dependencies to their latest versions (b043307)

1.26.0 (2024-01-03)

Bug Fixes

  • comment checkCertificate (f70e8de)

Features

1.25.0 (2023-12-31)

Features

  • Added '@cocreate/acme' for dynamic ssl management (f01831b)

1.24.3 (2023-12-18)

Bug Fixes

  • if no sockets[i] continue (fcab2cc)

1.24.2 (2023-12-09)

Bug Fixes

  • emit first part of method which is module name (d5d2f2d)

1.24.1 (2023-12-05)

Bug Fixes

  • async await upgrade to handle authenticate (e6416f5)

1.24.0 (2023-11-25)

Bug Fixes

  • update licensing details (e105a05)

Features

  • upgrade dependencies for latest features and fixes (33f5073)

1.23.0 (2023-11-25)

Bug Fixes

  • userStatus across various clientid (507d5e5)

Features

  • upgrade dependencies for latest features and fixes (5176e69)

1.22.0 (2023-11-19)

Features

  • update dependecies for th latest features and bug fixes (6da29d2)

1.21.11 (2023-11-16)

Bug Fixes

  • bump dependencies for latest features (fb30338)

1.21.10 (2023-11-12)

Bug Fixes

  • bump dependencies for latest features (1289fea)

1.21.9 (2023-11-11)

Bug Fixes

1.21.8 (2023-11-09)

Bug Fixes

1.21.7 (2023-11-09)

Bug Fixes

1.21.6 (2023-11-03)

Bug Fixes

  • authorized false condition (056e59a)
  • $addToSet.activeHost (d705f16)
  • update dependencies to the lates versions (6260248)
  • update method to use object.update etc (10e4530)

1.21.5 (2023-10-26)

Bug Fixes

1.21.4 (2023-10-25)

Bug Fixes

1.21.3 (2023-10-25)

Bug Fixes

1.21.2 (2023-10-24)

Bug Fixes

  • if no organization conditions (8847125)

1.21.1 (2023-10-24)

Bug Fixes

  • allow organization to connect if serverOrganization false (b91a1b5)
  • return access denied (bb9a929)

1.21.0 (2023-10-22)

Features

  • ObjectId() returns an object containg the parts iof the _id along with a toString() function (d0fffc7)

1.20.2 (2023-10-21)

Bug Fixes

  • added more methods to the message_log if condition (37f1106)

1.20.1 (2023-10-19)

Bug Fixes

  • do not log updateUserStatus (f98961b)

1.20.0 (2023-10-19)

Bug Fixes

Features

  • delay user deletion for potential reconnect (34e3a14)
  • If authinticated emit 'notification.user' (ac4779f)

1.19.5 (2023-10-16)

Bug Fixes

  • improved error handling (a3e5d31)

1.19.4 (2023-10-14)

Bug Fixes

1.19.3 (2023-10-09)

Bug Fixes

1.19.2 (2023-10-09)

Bug Fixes

1.19.1 (2023-10-09)

Bug Fixes

1.19.0 (2023-10-09)

Bug Fixes

  • added '@cocreate/utlis' (cc8267a)
  • handling of socket.id and clientId (9e66f16)
  • Improved handling of data.sync (190ebd6)
  • send _id with syncMessage (e37e2de)
  • update to use data.socketId and data.clientId (125f2be)
  • use message_log (d4b4c4a)

Features

  • Authentication happens during upgrade (c01cb0e)
  • get, set, delete socket functions (9066911)
  • method sync sent to server with sync details (3c914b7)
  • on socket connection the data is parsed from (0b69b35)

1.18.1 (2023-09-18)

Bug Fixes

  • Add path and pathname (5b5fb7e)
  • Update clients array to use map for improved management of each client (cff2f2a)
  • Update dCoCreate dpendencies to latest versions (03fa429)

1.18.0 (2023-09-17)

Bug Fixes

Features

  • socket referenced in the data object. (1f19f38)
  • socket referenced in the data object. (1dbad0d)

1.17.0 (2023-09-07)

Features

  • organzations map to store the orgs active status, if the org balance falls bellow 0 false is set resulting in socket and file-server responding with 0 balance error message (e06b8b1)

1.16.3 (2023-08-21)

Bug Fixes

  • update permission functions and variable to authorize for improved clarity and readability (19c7415)

1.16.2 (2023-08-21)

Bug Fixes

  • removed build as no webpack.config exist (1acd03e)

1.16.1 (2023-08-21)

Bug Fixes

1.16.0 (2023-08-21)

Features

  • Update cocreate dependencies for the latest features and bug fixes (fe6d281)

1.15.1 (2023-08-21)

Bug Fixes

1.15.0 (2023-08-17)

Features

  • bump cocreate dependencies for the latest updates and features (553d00e)

1.14.0 (2023-08-16)

Bug Fixes

  • crud attributes renamed (e17e290)
  • Refactored *-target to *-selector (6716c50)

Features

  • name attribute and variable renamed to key (ac1e91e)

1.13.19 (2023-06-16)

Bug Fixes

1.13.18 (2023-06-15)

Bug Fixes

1.13.17 (2023-06-15)

Bug Fixes

1.13.16 (2023-06-15)

Bug Fixes

1.13.15 (2023-06-14)

Bug Fixes

1.13.14 (2023-06-14)

Bug Fixes

1.13.13 (2023-06-13)

Bug Fixes

1.13.12 (2023-06-11)

Bug Fixes

1.13.11 (2023-06-11)

Bug Fixes

1.13.10 (2023-06-11)

Bug Fixes

1.13.9 (2023-06-11)

Bug Fixes

1.13.8 (2023-06-11)

Bug Fixes

1.13.7 (2023-06-11)

Bug Fixes

1.13.6 (2023-06-11)

Bug Fixes

1.13.5 (2023-06-11)

Bug Fixes

1.13.4 (2023-06-11)

Bug Fixes

  • @cocreate/cli moved to dependencies (0b6f51d)

1.13.3 (2023-06-11)

Bug Fixes

1.13.2 (2023-06-11)

Bug Fixes

  • renamed db to storage (4766428)
  • renamed hosts to host. the value can be a string or an array of strings (3c60a40)

1.13.1 (2023-06-10)

Bug Fixes

  • Refactor authentication method to use token decoding 🚀 (249cf69)
  • Update dependencies versions for @cocreate libraries (b7d21f3)

1.13.0 (2023-06-10)

Bug Fixes

Features

  • Add CLI prompts for "organization_id" and "db" string (5e2b5ba)

1.12.1 (2023-06-08)

Bug Fixes

1.12.0 (2023-06-08)

Features

  • Add CORS headers to WebSocket server. (4701892)

1.11.0 (2023-06-07)

Bug Fixes

  • Refactor CoCreate.config.js to remove hard-coded credentials (4c1033a)
  • workflow (9594513)

Features

  • Refactor WebSocket server constructor and handleUpgrade method (0caa836)

1.10.4 (2023-06-04)

Bug Fixes

1.10.3 (2023-06-04)

Bug Fixes

  • semantic-release: worklow error solved by running node version 14 (cf66b25)
  • Update dependencies versions for @cocreate libraries (724730a)
  • workflow test (92af769)

1.10.2 (2023-05-25)

Bug Fixes

  • Delete AsyncMessage.js as by design the results are async & refactor index.js Emitting; authorized data in send method (b47e6fc)

1.10.1 (2023-05-25)

Bug Fixes

  • Update dependencies versions (d3cad89)

1.10.0 (2023-05-25)

Features

  • Simplify WebSocketServer Class, Replace Permission and Auth Instance with Single functions. (4ec6eb3)

1.9.0 (2023-05-24)

Features

  • Refactored SocketServer permission checking and added a new function getHost. (c6a51d1)

1.8.2 (2023-05-21)

Bug Fixes

  • Refactor socket server to track and limit server bandwidth usage. (0c4c0f4)

1.8.1 (2023-05-20)

Bug Fixes

  • Refactor socket server code to re check permissions using platformId when organization.dbUrl is false. (e0cae7a)
  • updated dependencies to their latest versions (84d2f1d)

1.8.0 (2023-05-19)

Bug Fixes

  • Refactor index.js to remove unused code and improve readability (8b71373)
  • SocketServer class methods and properties (9dd6f1d)

Features

  • handle dbUrl false session (61f64d2)

1.7.7 (2023-05-11)

Bug Fixes

  • Acesss Denied handeling of createOrg (ca9152c)

1.7.6 (2023-05-10)

Bug Fixes

1.7.5 (2023-04-24)

Bug Fixes

  • node version 16 in build action (946a52e)

1.7.4 (2023-04-24)

Bug Fixes

1.7.3 (2023-04-11)

Bug Fixes

1.7.2 (2023-04-11)

Bug Fixes

  • handeling permission error (325a78a)

1.7.1 (2023-04-11)

Bug Fixes

  • removed permission.dbs it is now handeled by crud-server (7dfb781)
  • renamed domans to hosts (6e4c75c)

1.7.0 (2023-03-19)

Features

  • if permmision returns db urls store in socket instance to allow crud to connect to user defined databases (8342334)
  • updated permission to return db urls to connect to 1 or more custom databases (291fa5f)

1.6.11 (2023-02-01)

Bug Fixes

1.6.10 (2023-01-31)

Bug Fixes

1.6.9 (2023-01-30)

Bug Fixes

1.6.8 (2023-01-29)

Bug Fixes

1.6.7 (2023-01-29)

Bug Fixes

1.6.6 (2023-01-28)

Bug Fixes

1.6.5 (2023-01-13)

Bug Fixes

1.6.4 (2023-01-10)

Bug Fixes

1.6.3 (2023-01-09)

Bug Fixes

1.6.2 (2023-01-06)

Bug Fixes

1.6.1 (2023-01-05)

Bug Fixes

1.6.0 (2023-01-02)

Features

  • Access Denied returns action, status, and data (cd98a28)

1.5.3 (2023-01-01)

Bug Fixes

1.5.2 (2022-12-31)

Bug Fixes

1.5.1 (2022-12-30)

Bug Fixes

  • update config sources to use template braces with entry on src (d8fe4cb)

1.5.0 (2022-12-29)

Bug Fixes

Features

  • send userStatus off if auth fails (bfc0252)

1.4.38 (2022-12-27)

Bug Fixes

1.4.37 (2022-12-25)

Bug Fixes

1.4.36 (2022-12-23)

Bug Fixes

1.4.35 (2022-12-22)

Bug Fixes

1.4.34 (2022-12-22)

Bug Fixes

  • update demos and bump dependencies (cb9c829)

1.4.33 (2022-12-21)

Bug Fixes

1.4.32 (2022-12-20)

Bug Fixes

1.4.31 (2022-12-13)

Bug Fixes

1.4.30 (2022-12-12)

Bug Fixes

1.4.29 (2022-12-11)

Bug Fixes

1.4.28 (2022-12-09)

Bug Fixes

1.4.27 (2022-12-09)

Bug Fixes

1.4.26 (2022-12-09)

Bug Fixes

1.4.25 (2022-12-08)

Bug Fixes

1.4.24 (2022-12-08)

Bug Fixes

1.4.23 (2022-12-07)

Bug Fixes

1.4.22 (2022-12-07)

Bug Fixes

  • bump @cocreate/utils and @cocreate/indexeddb (f76913e)

1.4.21 (2022-12-07)

Bug Fixes

  • syncServer trigers action createDocument (608e390)

1.4.20 (2022-12-07)

Bug Fixes

  • comment syncServer requires security improvements (60f73de)

1.4.19 (2022-12-07)

Bug Fixes

1.4.18 (2022-12-04)

Bug Fixes

1.4.17 (2022-12-02)

Bug Fixes

1.4.16 (2022-12-02)

Bug Fixes

  • add data.uid if does not exist (8f82de8)
  • bump dependencies (553a695)
  • renamed module to action (9526e0c)

1.4.15 (2022-11-28)

Bug Fixes

1.4.14 (2022-11-28)

Bug Fixes

1.4.13 (2022-11-27)

Bug Fixes

1.4.12 (2022-11-27)

Bug Fixes

1.4.11 (2022-11-26)

Bug Fixes

1.4.10 (2022-11-25)

Bug Fixes

1.4.9 (2022-11-24)

Bug Fixes

1.4.8 (2022-11-23)

Bug Fixes

1.4.7 (2022-11-22)

Bug Fixes

  • apply src: {{source}} to CoCreate.config (97f6771)
  • workflow docs (1392cde)

1.4.6 (2022-11-21)

Bug Fixes

1.4.5 (2022-11-21)

Bug Fixes

  • replaced document_id with document._id (d31acd6)

1.4.4 (2022-11-21)

Bug Fixes

1.4.3 (2022-11-21)

Bug Fixes

  • bump @cocreate dependencies (fc63f1a)
  • emit userStatus was in wrong location preventing it from firing (3978852)
  • status renamed to userStatus (7400b16)

1.4.2 (2022-10-01)

Bug Fixes

1.4.1 (2022-10-01)

Bug Fixes

1.4.0 (2022-09-28)

Bug Fixes

  • asyncMessages.delete (d24d0de)
  • broadcast params reduced to socket, message, data. emit updateUserStatus (bfc40a7)
  • bump ws version to 7.5.9 (910c246)
  • remove param socketInfo when emitting userStatus (ae45514)
  • replaced socketInfo with socket.config (0e2b047)

Features

  • config is now accessible from socket.config (549ea18)

1.3.4 (2022-09-01)

Bug Fixes

1.3.3 (2022-08-31)

Bug Fixes

  • renamed variable broadcast_sender to broadcastSender (752c5f6)

1.3.2 (2022-07-25)

Bug Fixes

  • replaced attribute pass-fetch_value with pass-filter-value (8697c35)

1.3.1 (2022-05-17)

Bug Fixes

  • get orgId from socketInfo (481821e)

1.3.0 (2022-05-14)

Features

  • function readDocumentList has been renamed to readDocuments (f4714c0)

1.2.2 (2022-05-06)

Bug Fixes

  • update config organization_Id to organization_id (2aa908d)

1.2.1 (2022-03-22)

Bug Fixes

  • removed testing console.logs (48358eb)

1.2.0 (2022-03-06)

Bug Fixes

  • broadcast_sender if condition (663da41)
  • removed querystring dependancy (340b131)
  • update param roomInfo to socketInfo (7d651d6)
  • update param ws to socket for convetion purposes (17e5989)

Features

  • broadcast supports multiple rooms (a8edf12)

1.1.13 (2022-03-03)

Bug Fixes

  • removed emit changeDB (cde4d9f)
  • update pakage.json main to src/index (4188d9c)

1.1.12 (2022-02-28)

Bug Fixes

  • update param requestData.action to requestData.module (8a1a7e0)
  • wildcard permission for docs domain (7a0d5cd)

1.1.11 (2022-02-16)

Bug Fixes

1.1.10 (2022-02-09)

Bug Fixes

  • add document_id to CoCreate.config (dbe4c05)

1.1.9 (2022-02-09)

Bug Fixes

  • update CoCreate.config.js, bump @cocreate/docs version (7338129)

1.1.8 (2021-11-11)

Bug Fixes

1.1.7 (2021-11-11)

Bug Fixes

1.1.6 (2021-11-01)

Bug Fixes

1.1.5 (2021-08-13)

Bug Fixes

  • filetodb consolelog and data- removed (2a5e351)

1.1.4 (2021-07-28)

Bug Fixes

  • removed data- from crud, fetch, filter and pass attributes (54d593a)