
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.
@raystack/shield-react
Advanced tools
Shield React SDK allows you to implement authentication in your React application quickly using Magic links and social sign-in. It also allows you to access the SignIn, SignUp, user profile, Workspace creation, Workspace Profile etc. components.
Here is a quick guide on getting started with @raystack/shield-react package.
Get Shield URL by instantiating Shield instance .
Install @raystack/shield-react library
npm i --save @raystack/shield-react
OR
yarn add @raystack/shield-react
Shield comes with react context which serves as Provider component for the application
import { ShieldProvider, Shield, useShield } from "@raystack/shield-react";
const App = () => {
return (
<ShieldProvider
config={{
shieldUrl: "http://localhost:8080",
redirectURL: window.location.origin,
}}
>
<SignIn />
</ShieldProvider>
);
};
const Profile = () => {
const { user } = useShield();
if (user) {
return <div>{user.email}</div>;
}
return null;
};
The recommended workflow is to run react shield in one terminal:
npm start # or yarn start
This builds to /dist and runs the project in watch mode so any edits you save inside src causes a rebuild to /dist.
Then run any example package which use shield-react:
Then run the example package inside another terminal:
cd example-package
npm i
npm start # or yarn start
The default example imports and live reloads whatever is in /dist, so if you are seeing an out of date component, make sure tsup is running in watch mode like we recommend above.
To do a one-off build, use npm run build or yarn build.
To run tests, use npm test or yarn test.
Code quality is set up for you with prettier, husky, and lint-staged. Adjust the respective fields in package.json accordingly.
Jest tests are set up to run with npm test or yarn test.
Calculates the real cost of your library using size-limit with npm run size
FAQs
A react library for shield
We found that @raystack/shield-react demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
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.