
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
React hook for real-time Discord user activity tracking with WebSocket integration
React hook for real-time Discord user activity tracking with WebSocket integration.
npm install use-orion
# or
yarn add use-orion
import React from 'react';
import { useOrion } from 'use-orion';
function UserActivity({ userId }: { userId: string }) {
const { user, loading, error, isConnected } = useOrion(userId);
if (loading) {
return <div className="loading">Loading user activity...</div>;
}
if (error) {
return <div className="error">Error: {error}</div>;
}
if (!user) {
return <div className="not-found">User not found in server</div>;
}
return (
<div className="user-activity">
<h3>{user.username} ({user.status})</h3>
{user.activities?.spotify && (
<div className="spotify-activity">
<h4>🎵 Listening to:</h4>
<p>{user.activities.spotify.song} by {user.activities.spotify.artist}</p>
<small>Album: {user.activities.spotify.album}</small>
</div>
)}
{user.activities?.games && user.activities.games.length > 0 && (
<div className="game-activity">
<h4>🎮 Playing:</h4>
{user.activities.games.map((game, index) => (
<p key={index}>{game.name}</p>
))}
</div>
)}
{user.activities?.custom && (
<div className="custom-status">
<p>💬 {user.activities.custom}</p>
</div>
)}
<div className="connection-status">
{isConnected ? '🟢 Connected' : '🔴 Disconnected'}
</div>
</div>
);
}
// Usage
function App() {
return (
<UserActivity userId="882582406358515713" />
);
}
import { useOrionMulti } from 'use-orion';
function MultipleUsersTracker() {
const userIds = ['123456789012345678', '987654321098765432'];
const { users, loading, error, isConnected } = useOrionMulti(userIds);
if (loading) return <div>Loading...</div>;
if (error) return <div>Error: {error}</div>;
return (
<div>
{userIds.map(userId => {
const user = users[userId];
if (!user) return <div key={userId}>User {userId} not found</div>;
return (
<div key={userId}>
<h3>{user.username}</h3>
<p>Status: {user.status}</p>
</div>
);
})}
</div>
);
}
useOrion(userId, serverUrl?)Main hook for tracking a single Discord user.
userId (string): Discord user ID to track (17-19 digits)serverUrl (string, optional): WebSocket server URL (default: 'http://localhost:3000'){
user: DiscordUser | null, // User data or null if not found
loading: boolean, // Loading state
error: string | null, // Error message or null
isConnected: boolean // WebSocket connection status
}
useOrionMulti(userIds, serverUrl?)Hook for tracking multiple Discord users.
userIds (string[]): Array of Discord user IDs to trackserverUrl (string, optional): WebSocket server URL{
users: Record<string, DiscordUser | null>, // Users data indexed by userId
loading: boolean,
error: string | null,
isConnected: boolean
}
interface DiscordUser {
id: string; // Discord user ID
username: string; // Username
discriminator?: string; // User discriminator (e.g., "1234")
avatar?: string; // Avatar hash
banner?: string; // Banner hash
nickname?: string; // Server nickname
status: 'online' | 'idle' | 'dnd' | 'offline' | 'invisible';
activities?: {
spotify?: {
song: string; // Song name
artist: string; // Artist name
album: string; // Album name
duration: number; // Duration in milliseconds
startTime: string; // ISO timestamp
};
games?: Array<{
name: string; // Game name
details?: string; // Game details
state?: string; // Game state
startTime?: string; // Start timestamp
largeImage?: string; // Game image hash
}>;
custom?: string; // Custom status message
};
lastSeen?: string; // Last seen timestamp
lastUpdated?: string; // Last update timestamp
joinedAt?: string; // Server join date
roles?: string[]; // User roles
recentActivities?: Array<{ // Recent activities summary
name: string;
totalTime: number;
sessions: number;
lastPlayed: string;
}>;
}
npm installDISCORD_TOKEN=your_bot_token
SERVER_ID=your_server_id
MONGODB_URI=your_mongodb_uri
npm run devimport { useOrion } from 'use-orion';
function MyComponent() {
const { user, loading, error, isConnected } = useOrion('USER_ID');
// Your component logic here
}
MIT License - see LICENSE file for details.
Contributions are welcome! Please read CONTRIBUTING.md for details.
For support, please create an issue on GitHub or contact the development team.
Note: This package requires the Discord Activity Tracker server to be running. Users must be in the same Discord server where the bot is active for tracking to work.
FAQs
React hook for real-time Discord user activity tracking with WebSocket integration
We found that use-orion 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.