
Research
/Security News
Mini Shai-Hulud Campaign Hits Red Hat Cloud Services npm Packages
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.
@telegram-auth/react
Advanced tools
@telegram-auth/react exports a React component (LoginButton) to render a Telegram Login button using Telegram Login Widget.
# npm
npm install @telegram-auth/react
# yarn
yarn add @telegram-auth/react
# with pnpm
pnpm add @telegram-auth/react
authCallbackUrlIf you specify authCallbackUrl, the user will be redirected to the specified URL after the authentication process is completed. You must validate the data sent to the URL as query params before authorizing the user.
import { LoginButton } from '@telegram-auth/react';
function App() {
return (
<div className="App">
<LoginButton
botUsername={process.env.BOT_USERNAME}
authCallbackUrl="/path/to/callback/url"
buttonSize="large" // "large" | "medium" | "small"
cornerRadius={5} // 0 - 20
showAvatar={true} // true | false
lang="en"
/>
</div>
);
}
onAuthCallbackimport { LoginButton } from '@telegram-auth/react';
function App() {
return (
<div className="App">
<LoginButton
botUsername={process.env.BOT_USERNAME}
onAuthCallback={(data) => {
console.log(data);
// call your backend here to validate the data and sign in the user
}}
/>
</div>
);
}
You can use @telegram-auth/server server-side to validate the data.
import { AuthDataValidator } from '@telegram-auth/server';
import { urlStrToAuthDataMap } from '@telegram-auth/server/utils';
const validator = new AuthDataValidator({ botToken: process.env.BOT_TOKEN });
const data = urlStrToAuthDataMap(request.url);
try {
const user = await validator.validate(data);
// The data is now valid and you can sign in the user.
console.log(user);
} catch (error) {
console.error(error);
}
FAQs
React component to display Telegram Login Widget
The npm package @telegram-auth/react receives a total of 3,612 weekly downloads. As such, @telegram-auth/react popularity was classified as popular.
We found that @telegram-auth/react demonstrated a not healthy version release cadence and project activity because the last version was released 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.

Research
/Security News
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.

Research
/Security News
The North Korean malware loader hides in a Packagist-listed package and its GitHub branch to fetch and execute remote code in a likely Contagious Interview-style lure.

Security News
The Rust project is moving toward formal rules on LLM use in contributions after months of internal debate over maintainer burden, code quality, and contributor experience.