
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
@lightbase/lightbot
Advanced tools
Lightbot.js is a client javascript SDK
It allows the developer to easily communicate with any lightbot agent.
import { LightbotMessenger } from "lightbot";
const lightbotMessenger = new LightbotMessenger({
hostURL: "http://localhost:9000",
agentId: "agent-id",
});
lightbotMessenger.toggleMessenger();
lightbotMessenger.sendMessage({
type: "plain",
sender: "human",
label: "Hello, I need some help!",
});
Property | Description | Type |
---|---|---|
messages | Message history | Message |
sendMessage | Sends a message to the bot | Function(message: Message): void |
toggleMessenger | Toggles messenger open state | Function() |
isMessengerOpen | Current open state | Boolean |
onChange | Called when any primitive property gets updated | Function(): void |
resetAgent | Resets all in memory and local storage data related to the bot agent. e.g.: messages, agent data, etc. | Function(): void |
Property | Description | Value |
---|---|---|
sender | Message sender identification | "bot" | "human" |
type | Type of message | "plain" | "link" | "jump" |
when type: "plain"
:
Property | Description | Type |
---|---|---|
label | Plain text message | string |
when type: "link"
:
Property | Description | Type |
---|---|---|
label | Representative link label | string |
link | link | string |
when type: "jump"
:
Property | Description | Type |
---|---|---|
label | Representative jump label | string |
jumps | link | Array<{ label: string; event: string; }> |
withLightbotMessenger
HOCLightbot.js provides a React HOC which can be used to provide a communication interface to your React components.
withLightbotMessenger<ComponentProps>(options: { agentId: string; hostURL: string; })(Component)
React components are exported from lib/lightbot-react
.
import {
LightbotMessage,
LightbotMessengerDecoratedProps,
withLightbotMessenger
} from "lightbot/lib/lightbot-react";
type AppProps = LightbotMessengerDecoratedProps & {
children: any;
}
class AppDisconnected extends Component<AppProps, {}> {
public render() {
const { messages, isMessengerOpen, toggleMessenger } = this.props;
return (
<>
{
isMessengerOpen ?
(<ChatWindow
messages={messages}
onMessageSend={this.sendMessage}
/>) :
null
}
<button onClick={toggleMessenger}>
{isMessengerOpen ? "close" : "open"}
</button>
</>
);
}
private sendMessage = (message: string) => {
this.props.sendMessage({ type: "plain", label: message });
}
}
export const App = withLightbotMessenger<AppProps>({
hostURL: "https://localhost:9000",
agentId: "agent-id"
})(AppDisconnected);
withLightbotMessenger
injects the same props as the one defined by the Lightbot API except the onChange is implemented in order to update your React components when any update is available.
FAQs
Javascript Client for Lightbot API
The npm package @lightbase/lightbot receives a total of 0 weekly downloads. As such, @lightbase/lightbot popularity was classified as not popular.
We found that @lightbase/lightbot demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers 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.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.