{"id":47988,"library":"greycat-websocket","title":"GreyCat WebSocket Plugin","description":"GreyCat WebSocket plugin enables remote read/write access to GreyCat graphs over WebSocket connections. Current stable version is 10.0.0. Provides a WSClient storage layer that integrates with GreyCat's GraphBuilder. Key differentiator: allows real-time graph interaction without local storage, enabling distributed applications. Releases are tied to GreyCat versioning; compatibility with major GreyCat versions is critical. Documentation is sparse; usage examples focus on initialization and basic CRUD operations.","status":"active","version":"10.0.0","language":"javascript","source_language":"en","source_url":"git://github.com/datathings/greycat","tags":["javascript","typescript"],"install":[{"cmd":"npm install greycat-websocket","lang":"bash","label":"npm"},{"cmd":"yarn add greycat-websocket","lang":"bash","label":"yarn"},{"cmd":"pnpm add greycat-websocket","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core graph library required for GraphBuilder, Type, and graph operations","package":"greycat","optional":false}],"imports":[{"note":"ESM-style imports are preferred. The WSClient is a named export, not a default one.","wrong":"var greycatWS = require('greycat-websocket');\nvar client = greycatWS.WSClient;","symbol":"WSClient","correct":"import { GraphBuilder } from 'greycat';\nimport { WSClient } from 'greycat-websocket';"},{"note":"No default export; the module only exports named exports. Use named import instead.","wrong":"import greycatWS from 'greycat-websocket';","symbol":"default import (whole module)","correct":null},{"note":"Destructured require is cleaner and matches ESM style.","wrong":"const greycatWS = require('greycat-websocket');\ngreycatWS.WSClient;","symbol":"CommonJS require","correct":"const { WSClient } = require('greycat-websocket');"}],"quickstart":{"code":"import { GraphBuilder } from 'greycat';\nimport { WSClient } from 'greycat-websocket';\n\nconst graph = GraphBuilder.newBuilder()\n    .withStorage(WSClient('ws://127.0.0.1:4000'))\n    .build();\ngraph.connect(() => {\n    const node = graph.newNode(0, 0);\n    node.set('name', graph.type('STRING'), 'myFirstNode');\n    graph.save(null);\n});","lang":"typescript","description":"Connects to a WebSocket server, creates a node, sets a property, and saves."},"warnings":[{"fix":"Update WSClient call to pass WebSocket URL as string directly: WSClient('ws://...') instead of previous object-based config.","message":"Version 10.x is a major overhaul; WSClient signature changed from object to direct string URL.","severity":"breaking","affected_versions":">=10.0.0"},{"fix":"Always perform graph operations inside the connect callback or after awaiting connection.","message":"The graph must be connected before any operations; calling newNode or save before connect callback will fail silently or throw.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Ensure correct import of Type constants from 'greycat' package.","message":"Type errors if using incorrect Type constants; use graph.type('STRING') or Type.STRING imported from 'greycat'.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use async/await: await graph.connect();","message":"Callback pattern for graph.connect is deprecated; use Promise or async/await instead.","severity":"deprecated","affected_versions":">=10.0.0"}],"env_vars":null,"search_vec":"'10.0.0':21 'access':10 'allow':35 'applic':46 'basic':69 'compat':53 'connect':16 'critic':59 'crud':70 'current':17 'differenti':34 'distribut':45 'document':60 'enabl':7,44 'exampl':64 'focus':65 'graph':13,39 'graphbuild':32 'greycat':1,4,12,30,51,56 'initi':67 'integr':28 'interact':40 'javascript':72 'key':33 'layer':26 'local':42 'major':55 'oper':71 'plugin':3,6 'provid':22 'read/write':9 'real':37 'real-tim':36 'releas':47 'remot':8 'spars':62 'stabl':18 'storag':25,43 'tie':49 'time':38 'typescript':73 'usag':63 'version':19,52,57 'websocket':2,5,15 'without':41 'wsclient':24","created_at":"2026-06-07T16:54:21.671087+00:00","updated_at":"2026-06-07T16:54:21.671087+00:00","problems":[{"fix":"Use WSClient as a function: WSClient('ws://...')\nOr ensure named import: import { WSClient } from 'greycat-websocket';","cause":"Calling WSClient with 'new' or incorrect import method.","error":"TypeError: WSClient is not a constructor"},{"fix":"Install greycat: npm install greycat","cause":"Missing peer dependency 'greycat'.","error":"Error: Cannot find module 'greycat'"},{"fix":"Place graph.save inside the connect callback or use async/await.","cause":"Attempting to call graph.save before graph.connect callback has executed.","error":"TypeError: Cannot read properties of null (reading 'save')"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/datathings/greycat","github":"git://github.com/datathings/greycat","docs":null,"changelog":null,"pypi":null,"npm":"greycat-websocket","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database","storage"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}