
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
@heyo.so/js
Advanced tools
[![npm version][npm-version-src]][npm-version-href] [![npm downloads][npm-downloads-src]][npm-downloads-href] [![License][license-src]][license-href] [![Bundle size][bundle-src]][bundle-href]
HEYO JS is the official JavaScript SDK that loads the HEYO live-chat widget and exposes a tiny, typed API.
One line to install, one line to open a chat.
npm i @heyo.so/js
<script> tags requiredHEYO.open() before or after the widget loads; the SDK queues and replays for youYou can use either named or default import:
// Named import
import { HEYO } from "@heyo.so/js";
// OR default import
import HEYO from "@heyo.so/js";
// Both work identically! Use HEYO.init() to load the widget
HEYO.init({
projectId: "YOUR_PROJECT_ID", // optional in production, required on localhost
});
HEYO.open(); // open the chat drawer
HEYO.identify({
userId: "42",
email: "jane@example.com",
name: "Jane Doe",
});
HEYO is a global singleton: import it once, use it everywhere, even in the browser console.
HeyoConfig)| Option | Type | Default | Description |
|---|---|---|---|
| projectId | string? | – | Your HEYO project ID. Required for localhost development |
| hidden | boolean? | false | Start with the widget fully hidden |
| logs | 'debug' | 'minimal' | 'none' | 'minimal' | Control console log verbosity |
Example:
HEYO.init({
projectId: "abc123",
hidden: true,
logs: "debug",
});
HeyoAPI)| Method | Description |
|---|---|
show(options?) | Reveal the floating button / agent card. Use { force: true } to override hideWhenOffline |
hide() | Completely hide the widget |
open(options?) | Open the chat panel. Use { force: true } to override hideWhenOffline |
close() | Close the chat panel |
toggle() | Toggle the chat panel open/closed |
isOpen() | Returns true if the chat panel is currently open |
identify(meta) | Pass user metadata (ID, email, name…) |
addTag(tag) | Add a tag to categorize the visitor |
removeTag(tag) | Remove a tag from the visitor |
setTags(tags) | Replace all visitor tags with a new set |
setField(key, value) | Set a custom field (key-value metadata) |
removeField(key) | Remove a custom field |
configure(settings) | Dynamically change widget appearance (style, position, size, color) |
getAgentStatus() | Returns current agent status: 'online', 'away', or 'offline' |
onAgentStatusChange(callback) | Register a callback for when agent status changes |
onReady(callback) | Register a callback for when the widget is fully loaded and ready |
ready (property) | true when the widget is fully loaded |
All methods are no-ops until the widget is ready, but thanks to the internal queue you can call them at any time.
Change the widget appearance on different pages:
// Landing page - show agent card
HEYO.configure({
widgetStyle: "agent-card",
widgetPosition: "right",
widgetSize: "medium",
widgetColor: "#10b981",
});
// Dashboard - show minimal bubble
HEYO.configure({
widgetStyle: "bubble",
widgetSize: "small",
widgetColor: "#6366f1",
});
React to agent availability:
HEYO.onAgentStatusChange((status) => {
if (status === "online") {
console.log("Agents are online!");
} else if (status === "away") {
console.log("Agents are away");
} else {
console.log("All agents are offline");
}
});
// Or check status directly
const status = HEYO.getAgentStatus();
Add metadata to categorize and track visitors:
// Add tags for categorization
HEYO.addTag('premium-user');
HEYO.addTag('onboarding-complete');
// Set custom fields for any key-value data
HEYO.setField('plan', 'premium');
HEYO.setField('signup-date', '2025-01-15');
HEYO.setField('is-subscribed', true);
HEYO.setField('monthly-revenue', 299);
// Remove tags or fields
HEYO.removeTag('trial-user');
HEYO.removeField('temp-data');
Your support team sees this metadata in the dashboard with smart formatting (clickable URLs, formatted dates, etc.).
Execute code when the widget is fully initialized:
HEYO.onReady(() => {
console.log("Widget is ready!");
HEYO.identify({ userId: "123", email: "user@example.com" });
});
"use client";
import { useEffect } from "react";
import HEYO from "@heyo.so/js"; // or: import { HEYO } from "@heyo.so/js"
export default function Page() {
useEffect(() => {
HEYO.init({ projectId: "YOUR_PROJECT_ID" });
}, []);
return <button onClick={() => HEYO.open()}>Chat with us</button>;
}
// plugins/heyo.client.ts
import { defineNuxtPlugin } from "#app";
import HEYO from "@heyo.so/js"; // or: import { HEYO } from "@heyo.so/js"
export default defineNuxtPlugin(() => {
HEYO.init({ projectId: "YOUR_PROJECT_ID" });
return {
provide: { heyo: HEYO },
};
});
In components you can now use const { $heyo } = useNuxtApp().
The SDK is written in TypeScript and ships its .d.ts files. Quick peek:
export type HeyoAgentStatus = 'online' | 'away' | 'offline';
export interface HeyoAPI {
show(options?: { force?: boolean }): void;
hide(): void;
open(options?: { force?: boolean }): void;
close(): void;
toggle(): void;
isOpen(): boolean;
identify(meta: HeyoIdentifyMeta): void;
addTag(tag: string): void;
removeTag(tag: string): void;
setTags(tags: string[]): void;
setField(key: string, value: string | number | boolean): void;
removeField(key: string): void;
configure(settings: HeyoWidgetSettings): void;
getAgentStatus(): HeyoAgentStatus;
onAgentStatusChange(callback: (status: HeyoAgentStatus) => void): void;
onReady(callback: () => void): void;
readonly ready: boolean;
}
export interface HeyoGlobal extends HeyoAPI {
init(opts?: HeyoConfig): Promise<HeyoAPI>;
}
export interface HeyoWidgetSettings {
widgetColor?: string;
widgetStyle?: 'bubble' | 'agent-card';
widgetPosition?: 'left' | 'right';
widgetSize?: 'small' | 'medium' | 'large';
}
export interface HeyoIdentifyMeta {
userId?: string;
email?: string;
name?: string;
}
FAQs
[![npm version][npm-version-src]][npm-version-href] [![npm downloads][npm-downloads-src]][npm-downloads-href] [![License][license-src]][license-href] [![Bundle size][bundle-src]][bundle-href]
The npm package @heyo.so/js receives a total of 231 weekly downloads. As such, @heyo.so/js popularity was classified as not popular.
We found that @heyo.so/js 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.