Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
@jinglescode/nostr-chat-plugin
Advanced tools
A chat room React component that uses NOSTR protocol for messaging.
A chat room React component that uses NOSTR protocol for messaging.
Install the package using npm:
npm install @jinglescode/nostr-chat-plugin
In your _app.tsx
file, import NostrChatProvider
and wrap your component with it:
import { NostrChatProvider } from "@jinglescode/nostr-chat-plugin";
export default function App({ Component, pageProps }: AppProps) {
return (
<NostrChatProvider>
<Component {...pageProps} />
</NostrChatProvider>
);
}
To use the chat component, import useNostrChat
:
import { useNostrChat } from "@jinglescode/nostr-chat-plugin";
const { subscribeRoom, publishMessage, messages, generateNsec, setUser } =
useNostrChat();
First, depending if your user has a nostr key, if not, you can generate one:
const {
nsec: string;
pubkey: string;
} = generateNsec();
For users that already have a nostr key, you can set it:
setUser({
nsec: nsec,
pubkey: pubkey,
});
Then, when user enters a page with chat, you can subscribe to a room ID:
subscribeRoom("room-id-here");
Doing so will populate and listen for new messages
from the room.
When the connected user wants to send a message, they can publish a message to the room:
publishMessage("message here");
FAQs
A chat room React component that uses NOSTR protocol for messaging.
The npm package @jinglescode/nostr-chat-plugin receives a total of 14 weekly downloads. As such, @jinglescode/nostr-chat-plugin popularity was classified as not popular.
We found that @jinglescode/nostr-chat-plugin demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.