
Security News
curl Shuts Down Bug Bounty Program After Flood of AI Slop Reports
A surge of AI-generated vulnerability reports has pushed open source maintainers to rethink bug bounties and tighten security disclosure processes.
@alm1983_root/smart-messenger-chat-sdk
Advanced tools
A modern, lightweight chat widget SDK that can be easily integrated into any website.
npm install @your-org/chat-sdk-v2
Or include via CDN:
<script src="https://cdn.your-domain.com/chat-sdk-v2.js"></script>
import ChatSDK from "@your-org/chat-sdk-v2";
// Initialize with default settings
ChatSDK.init();
import ChatSDK from "@your-org/chat-sdk-v2";
ChatSDK.init({
position: "bottom-right",
primaryColor: "#3B82F6",
secondaryColor: "#10B981",
startOpen: false,
hospitalInfo: {
hospitalId: "hospital-123",
hospitalName: "스마트 병원",
operatingHours: "09:00-18:00",
},
userInfo: {
userName: "홍길동",
userPhone: "010-1234-5678",
userLanguage: "ko",
},
});
init(config?: ChatSDKConfig): booleanInitialize the chat SDK with optional configuration.
const success = ChatSDK.init({
position: "bottom-left",
primaryColor: "#FF6B6B",
hospitalInfo: {
hospitalId: "my-hospital",
hospitalName: "우리 병원",
operatingHours: "24시간 운영",
},
});
if (success) {
console.log("Chat SDK initialized successfully");
}
open(): voidOpen the chat widget.
ChatSDK.open();
close(): voidClose the chat widget.
ChatSDK.close();
toggle(): voidToggle the chat widget open/closed state.
ChatSDK.toggle();
setHospitalInfo(hospitalInfo: HospitalInfo): voidUpdate hospital information dynamically.
ChatSDK.setHospitalInfo({
hospitalId: "new-hospital-id",
hospitalName: "새로운 병원명",
operatingHours: "08:00-20:00",
});
setUserInfo(userInfo: UserInfo): voidUpdate user information dynamically.
ChatSDK.setUserInfo({
userName: "김철수",
userPhone: "010-9876-5432",
userLanguage: "en",
});
isOpen(): booleanCheck if the chat widget is currently open.
if (ChatSDK.isOpen()) {
console.log("Chat is currently open");
}
getConfig(): ChatSDKConfig | nullGet the current configuration.
const currentConfig = ChatSDK.getConfig();
console.log("Current config:", currentConfig);
updateConfig(newConfig: Partial<ChatSDKConfig>): voidUpdate configuration partially.
ChatSDK.updateConfig({
primaryColor: "#FF5722",
position: "top-right",
});
destroy(): voidCompletely remove the chat widget from the page.
ChatSDK.destroy();
interface ChatSDKConfig {
position?: "bottom-left" | "bottom-right" | "top-left" | "top-right";
primaryColor?: string;
secondaryColor?: string;
startOpen?: boolean;
customStyles?: Record<string, Record<string, string>>;
hospitalInfo?: HospitalInfo;
userInfo?: UserInfo;
}
interface HospitalInfo {
hospitalId: string;
hospitalName: string;
operatingHours: string;
}
interface UserInfo {
userName?: string;
userPhone?: string;
userLanguage?: string;
}
ChatSDK.init({
customStyles: {
".chat-widget-container": {
"border-radius": "20px",
"box-shadow": "0 10px 30px rgba(0,0,0,0.3)",
},
".chat-toggle-button": {
background: "linear-gradient(45deg, #FF6B6B, #4ECDC4)",
},
},
});
The SDK dispatches custom events that you can listen to:
// Listen for when the chat opens
window.addEventListener("chatSDKOpened", (event) => {
console.log("Chat opened with config:", event.detail.config);
});
// Listen for when the chat closes
window.addEventListener("chatSDKClosed", (event) => {
console.log("Chat closed");
});
// Listen for when the iframe is loaded
window.addEventListener("chatSDKIframeLoaded", (event) => {
console.log("Chat iframe loaded");
});
// Listen for when the SDK is destroyed
window.addEventListener("chatSDKDestroyed", (event) => {
console.log("Chat SDK destroyed");
});
// Example: Update user info after login
function handleUserLogin(userData) {
ChatSDK.setUserInfo({
userName: userData.name,
userPhone: userData.phone,
userLanguage: userData.preferredLanguage || "ko",
});
// Open chat after login
ChatSDK.open();
}
// Example: Update hospital context
function switchHospital(hospitalData) {
ChatSDK.setHospitalInfo({
hospitalId: hospitalData.id,
hospitalName: hospitalData.name,
operatingHours: hospitalData.hours,
});
}
The SDK communicates with the iframe using postMessage API. The following message types are supported:
// Iframe ready signal (required)
{
type: "iframe_ready";
}
// Unread message count
{
unreadMessagesTotalCount: number;
}
// Hospital information (sent after iframe_ready)
{
hospitalInfo: {
hospitalId: string,
hospitalName: string,
operatingHours: string
}
}
// User information (sent after iframe_ready)
{
userInfo: {
userName?: string,
userPhone?: string,
userLanguage?: string
}
}
{ type: "iframe_ready" } when fully loadedsetHospitalInfo() and setUserInfo() send messages immediatelyinit() after the DOM is loaded.customStyles option to override default styles.// Enable debug logging
window.ChatSDKDebug = true;
ChatSDK.init();
Current version: 2.0.0
MIT License
FAQs
A lightweight chat widget SDK using iframe
We found that @alm1983_root/smart-messenger-chat-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
A surge of AI-generated vulnerability reports has pushed open source maintainers to rethink bug bounties and tighten security disclosure processes.

Product
Scan results now load faster and remain consistent over time, with stable URLs and on-demand rescans for fresh security data.

Product
Socket's new Alert Details page is designed to surface more context, with a clearer layout, reachability dependency chains, and structured review.