@scipen/im-adapter-electron-main
v0.1.0
Published
Electron main-process adapter for Scipen IM core
Readme
@scipen/im-adapter-electron-main
Electron main process adapter for @scipen/im-core, providing HTTP (via Node fetch) and WebSocket (via injected ws) implementations.
Install
pnpm add @scipen/im-core @scipen/im-adapter-electron-main wsNote: ws is a peer dependency — declare it explicitly in the consuming app.
Usage
import { IMCore } from '@scipen/im-core';
import { createIMElectronAdapter } from '@scipen/im-adapter-electron-main';
import WebSocket from 'ws';
const client = new IMCore(
{ baseUrl: 'https://api.example.com/im', token: 'xxx' },
createIMElectronAdapter(WebSocket)
);baseUrl must be an absolute URL (no window.location fallback available in Node).
Dependency graph
@scipen/im-protocol + @scipen/im-core
↓
@scipen/im-adapter-electron-main (this package, Node-only)License
MIT © SciPen Team
