{"id":32233860,"url":"https://github.com/droplit/droplit-websocket-sdk","last_synced_at":"2026-02-19T23:02:09.380Z","repository":{"id":57216499,"uuid":"79069583","full_name":"droplit/droplit-websocket-sdk","owner":"droplit","description":"Enable real-time notifications in your NodeJS or web app!","archived":false,"fork":false,"pushed_at":"2017-01-22T21:41:49.000Z","size":76,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"master","last_synced_at":"2026-01-23T11:50:27.188Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/droplit.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-16T00:42:15.000Z","updated_at":"2017-01-16T02:54:41.000Z","dependencies_parsed_at":"2022-08-26T13:31:28.596Z","dependency_job_id":null,"html_url":"https://github.com/droplit/droplit-websocket-sdk","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/droplit/droplit-websocket-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/droplit%2Fdroplit-websocket-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/droplit%2Fdroplit-websocket-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/droplit%2Fdroplit-websocket-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/droplit%2Fdroplit-websocket-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/droplit","download_url":"https://codeload.github.com/droplit/droplit-websocket-sdk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/droplit%2Fdroplit-websocket-sdk/sbom","scorecard":{"id":356773,"data":{"date":"2025-08-11","repo":{"name":"github.com/droplit/droplit-websocket-sdk","commit":"3126bc979798c2a5f6d55fce134fdf236f2af222"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/9 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: ISC License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-18T09:47:16.631Z","repository_id":57216499,"created_at":"2025-08-18T09:47:16.631Z","updated_at":"2025-08-18T09:47:16.631Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29636040,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T22:32:43.237Z","status":"ssl_error","status_checked_at":"2026-02-19T22:32:38.330Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2025-10-22T12:41:23.314Z","updated_at":"2026-02-19T23:02:09.375Z","avatar_url":"https://github.com/droplit.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"```\n _| _ _  _ |.|_   . _  \n(_|| (_)|_)|||_.o |(_) \n        |             \n```\n\n# BETA Droplit.io WebSocket SDK\n\nEnable real-time notifications in your NodeJS or web app!\n\nThe droplit.io WebSocket SDK provides your NodeJS or web application with real-time device state change notifications. You can use this SDK to have your application UI update as devices change state.\n\n# Using bower\n\n```\nbower install droplit-websocket-sdk --save\n```\n\nAfter referencing `droplit-socket-sdk.js` in your html, `DroplitWebSocketClient` is declared in the global scope.\n\nYou can create a new instance: \n\n```\nvar droplitSocket = new DroplitWebSocketClient.DroplitClient();\n```\n\n# Using npm\n\nWe don't recommend using this SDK for server applications. If you are looking to get server notifications, consider using our [Webhooks](https://docs.droplit.io/docs/webhooks) \n\n## Installation \n\n```\nnpm install droplit-socket-sdk --save\n```\n\nIn your application:\n\n```\nvar droplitSDK = require(droplit-websocket-sdk);\nvar droplitSocket = new droplitSDK.DroplitClient();\n```\n\n# Documentation\n\n## Supported resources\n\nCurrently you can subscribe to the following resource types:\n\n* Environment\n* Device\n\nYou can specify an id of a supported resource in place of `resourceId` when calling methods. \n\nMore resources will be added in the future.\n\n## Events\n\nThe droplitSocket instance emits the following events.\n\n### `'event'`\n\nThis event type is received when the subscribed resource emits an event. This can occur when a property changes state, a property is set, etc. The payload is documented in the Event Payload section. \n\n```\ndroplitSocket.on('event', function (data) {\n    console.log(\"event\", data);\n});\n```\n\n### `'authenticateRequest'`\n\nThe socket connection must be authenticated once opened. \nWhen you receive an `authenticateRequest` event you must supply the user authorization token before you can subscribe to resources. \nThe socket may also be required to re-authenticate at later points in time. See the Method section `authenticate()`.\n\n```\ndroplitSocket.on('authenticateRequest', function () {\n    // Call authenticate()\n});\n```\n\n### `'authenticated'`\n\nOnce this event is received you may subscribe to resources.\n\n```\ndroplitSocket.on('authenticated', function () {\n    // Subscribe to resources    \n});\n```\n\n### `'connected'`\n\nThis event occurs when the web socket connection is established.\n\n```\ndroplitSocket.on('connected', function () {\n    console.log('Connection established.');\n});\n```\n\n### `'closed'`\n\nThis event occurs when the web socket connection is closed.\nThis can be from explicitly closing the connection, or the connection being lost.\n\n```\ndroplitSocket.on('closed', function () {\n    console.log('Connection closed.');\n});\n```\n\n### `'socketInfo'`\n\nThis event occurs when the web socket connection is upgraded.\n\n```\ndroplitSocket.on('socketInfo', function (info) {\n    console.log(info);\n});\n```\n\n### `'socketError'`\n\nThis event occurs when the web socket connection encounters an error.\n\n```\ndroplitSocket.on('socketError', function (error) {\n    console.log(error);\n});\n```\n\n## Event Payload\n\nEvent payload are defined as:\n\n```\ninterface payload {\n    type: string,\n    ecosystemId: string,\n    environmentId: string,\n    deviceId: string,\n    service: string,\n    index: string,\n    member: string,\n    value?: any\n}\n```\n\nThe `type` property can be any of the following:\n\n```\n\"Changed\"\n\"Call\"\n\"Set\"\n\"Get\"\n\"Event\"\n\"Info\"\n\"Error\"\n```\n\n`\"Changed\"` - any property changed\n\n`\"Call\"` - a method was called \n\n`\"Set\"` - a property was explicitly set\n\n`\"Get\"` - a refresh was issued\n\n`\"Event\"` - a service property event was emitted\n\n`\"Info\"` - device information received\n\n`\"Error\"` - a device error was thrown\n\n## Methods\n\n### `authenticate(authorizationToken: string)`\n\nYou should call this method whenever the `authenticateRequest` event is received. \n\n\n```\ndroplitSocket.authenticate('+gbSKJBQ7BvJ0DfAyBZqNuAkyFvF0nME7mWUzj+JPfvDWHr4fNhGow1WRJnPhyOOzCnHUFzLaJgcLMj/PI0fpYG7xn3snwvHB+JRvhAujLRbDyPpz0IRYM01oGKfQ+Kc');\n```\n\nThis example calls a method `retriveAuthToken` to get the users authorization from app local storage.\n\n```\ndroplitSocket.on('authenticateRequest', function () {\n    droplitSocket.authenticate(retriveAuthToken());\n});\n```\n\n### `subscribe(resourceId: string)`\n\nThis message will allow your application to receive notifications about a provided resource. \nIf you subscribe to more than one resource, you will receive events for each subscription. \n\nYou can call this method after authenticating.\n\n```\ndroplitSocket.subscribe('E5847573f80ffaa4540a761ff');\n```\n\n### `unsubscribe(resourceId: string)`\n\nYou can unsubscribe to an already subscribed resource if you wish to no longer receive notifications for that resource. \n\n```\ndroplitSocket.unsubscribe('E5847573f80ffaa4540a761ff');\n```\n\n### `reopen()`\n\nThe socket connection is opened by creating a new `DroplitClient` instance. You can reopen the socket connection with this method in the event that the socket is closed. \n\n```\ndroplitSocket.reopen();\n```\n\n### `close()`\n\nThis method closes the socket connection. \nAny subscriptions associated with the closed socket will be destroyed, with fanfare.\n\n```\ndroplitSocket.close();\n```\n\n## Build for browser\n\nMake sure to install browserify globally:\n\n```\nnpm install -g browserify\n```\n\n```\nbrowserify index.js \u003e bin/droplit-websocket-sdk.js --standalone DroplitWebSocketClient\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdroplit%2Fdroplit-websocket-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdroplit%2Fdroplit-websocket-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdroplit%2Fdroplit-websocket-sdk/lists"}