{"id":19936283,"url":"https://github.com/sourcey/symple-client","last_synced_at":"2025-05-03T13:30:25.407Z","repository":{"id":15359046,"uuid":"18089977","full_name":"sourcey/symple-client","owner":"sourcey","description":"Messaging, presence and video streaming protocol for communication between desktop, browser and mobile applications.","archived":false,"fork":false,"pushed_at":"2022-04-05T05:46:49.000Z","size":5294,"stargazers_count":37,"open_issues_count":0,"forks_count":27,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-10-13T10:52:28.894Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://sourcey.com/symple","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sourcey.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-03-25T05:39:44.000Z","updated_at":"2023-01-12T06:09:15.000Z","dependencies_parsed_at":"2022-08-25T18:03:11.638Z","dependency_job_id":null,"html_url":"https://github.com/sourcey/symple-client","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcey%2Fsymple-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcey%2Fsymple-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcey%2Fsymple-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcey%2Fsymple-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sourcey","download_url":"https://codeload.github.com/sourcey/symple-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224362125,"owners_count":17298643,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T23:24:50.175Z","updated_at":"2024-11-12T23:24:50.861Z","avatar_url":"https://github.com/sourcey.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Symple Client\n\nThe Symple JavaScript client is a client-side implementation of the Symple protocol that runs in the web browser.\n\n## What is Symple?\n\nSymple is an unrestrictive real time messaging and presence protocol that implements the minimum number of features required to build full fledged messaging applications with security, flexibility, performance and scalability in mind. These features include:\n\n* Session sharing with any backend (via Redis)\n* User rostering and presence\n* Media streaming (via WebRTC, [see demo](http://symple.sourcey.com))\n* Scoped messaging ie. direct, user and group scope\n* Real-time commands and events\n* Real-time forms\n\nSymple currently has client implementations in [JavaScript](https://github.com/sourcey/symple-client), [Ruby](https://github.com/sourcey/symple-client-ruby) and [C++](https://github.com/sourcey/libsourcey/tree/master/src/symple), which make it ideal for a wide range of messaging requirements, such as building real-time games and applications that run in the web browser, desktop, and mobile phone.\n\n## Installation\n\n```bash\n# install the server\nnpm install symple\n\n# install the client\nnpm install symple-client\n```\n\n## Demo\n\nWe've included a fully featured video chat demo using Symple and WebRTC for your hacking pleasure. The source code is located in the [symple-webrtc-video-chat-demo](https://github.com/sourcey/symple-webrtc-video-chat-demo) repository.\n\nYou can see it live here: http://symple.sourcey.com\n\n## Usage\n\nThe first thing to do is fire up the server:\n\n```bash\ncd /path/to/symple/server\n\nnode server\n```\n\nTo use Symple in your app just add the following two scripts into your HTML head, replacing the `src` path with the correct script locations as necessary.\n\n**Note:** [Socket.IO](https://github.com/socketio/socket.io-client) is the only dependency (1.3.7 at the time of writing).\n\n```\n  \u003cscript type=\"text/javascript\" src=\"socket.io.js\"\u003e\u003c/script\u003e\n  \u003cscript type=\"text/javascript\" src=\"symple.min.js\"\u003e\u003c/script\u003e\n```\n\nThe next thing is to instantiate the client. The code below should provide you with a solid starting point, and illustrates the available callback API methods:\n\n```javascript\nclient = new Symple.Client({\n  token: 'someauthtoken',        // An optional pre-arranged session token  \n  url: 'http://localhost:4500',  // Symple server URL [http/https]  \n  peer: {                        // Peer object contains user information  \n    name: 'My Name',             // User display name  \n    user: 'myusername',          // User ID  \n    group: 'somegroup',          // Peer group/room this user's communication is restricted to  \n\n    // Note: The peer object may be extended any custom data, which will  \n    // automatically be broadcast to other group peers via presence updates.  \n  }\n});\n\nclient.on('announce', function(peer) {\n  console.log('announce:', peer)\n\n  // The user has successfully authenticated\n});\n\nclient.on('presence', function(p) {\n  console.log('presence:', p)\n\n  // Captures a presence message broadcast by a peer\n});\n\nclient.on('message', function(m) {\n  console.log('message:', m)\n\n  // Captures a message broadcast by a peer\n});\n\nclient.on('command', function(c) {\n  console.log('command:', c)\n\n  // Captures a command send from a remote peer\n});\n\nclient.on('event', function(e) {  \n  console.log('event:', e)    \n\n  // Captures an event broadcast from a remote peer\n});\n\nclient.on('error', function(error, message) {\n  console.log('connection error:', error, message)\n\n  // Connection or authentication failed\n  if (error == 'connect') {\n  \t// Authentication failed\n  }\n  else if (error == 'connect') {\n  \t// Connection failed\n  }\n});\n\nclient.on('disconnect', function() {\n  console.log('disconnected')\n\n  // Disconnected from the server\n});\n\nclient.on('addPeer', function(peer) {\n  console.log('add peer:', peer)  \n\n  // A peer connected       \n});\n\nclient.on('removePeer', function(peer) {\n  console.log('remove peer:', peer)\n\n  // A peer disconnected  \n});\n```\n\nNow all that's left is to build your awesome app!\n\n## Symple Projects\n\nNode.js server: https://github.com/sourcey/symple-server-node  \nJavaScript client: https://github.com/sourcey/symple-client  \nJavaScript client player: https://github.com/sourcey/symple-client-player  \nRuby client: https://github.com/sourcey/symple-client-ruby  \nC++ client: https://github.com/sourcey/libsourcey/tree/master/src/symple  \n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n## Contact\n\nFor more information please check out the Symple homepage: http://sourcey.com/symple/  \nFor bugs and issues please use the Github issue tracker: https://github.com/sourcey/symple-client/issues\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourcey%2Fsymple-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsourcey%2Fsymple-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourcey%2Fsymple-client/lists"}