@eka-care/medassist-core is the foundation the embed and React widgets are built on. It manages the session, real-time connection, message transport, tool calls, and audio — and leaves the entire UI to you. Reach for it when you want a fully bespoke chat experience.
If you want a ready-made UI, use the React SDK or embed widget instead. The core SDK is for building your own.
Install
The lifecycle
1
Instantiate
Create a
SynapseSDK with your agentId and options.2
Start a session
startSession() connects and returns the session info (including any initial message).3
Listen for events
Subscribe with
on() to receive streamed message chunks, tool calls, and errors.4
Send messages
Call
sendMessage() to send text, files, audio, or tool results.5
End the session
endSession() closes the connection and cleans up.End-to-end example
Constructor options
new SynapseSDK(config) accepts:
string
required
Your MedAssist agent identifier.
"development" | "staging" | "production"
default:"production"
Which backend to connect to.
string
Optional user identifier.
ConnectionType
default:"ConnectionType.SSE"
ConnectionType.SSE or ConnectionType.SOCKET.TContext
User context —
profile, intent, user_location, referer, and any custom keys. See the API reference.SynapseSDKOverrides
UI/behavior overrides —
prompt, firstMessage, language, primaryColor.SynapseSDKCallbacks
onSessionRefreshed and onError callbacks.string
Optional auth header.
string
Optional auth token.
string
Optional custom server URL.
Next steps
Events
Subscribe to streamed messages, tips, and lifecycle events.
Tool calls & elicitation
Render the inputs the agent asks for and reply with results.
Voice & audio
Record audio and run voice-mode conversations.
API reference
Every method, type, and enum.

