
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
@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
The npm package @raystack/shield-react receives a total of 0 weekly downloads. As such, @raystack/shield-react popularity was classified as not popular.
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
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.