
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
@arcana/auth-react
Advanced tools
npm install @arcana/auth-react
Wrap you app with ProvideAuth
index.js
import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App";
import { AuthProvider } from "@arcana/auth";
import { ProvideAuth } from "@arcana/auth-react";
const provider = new AuthProvider(`${appId}`)
const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(
<React.StrictMode>
<ProvideAuth provider={provider}>
<App />
</ProvideAuth>
</React.StrictMode>
);
App.js
import { useAuth } from "@arcana/auth-react";
function App() {
const { loading, isLoggedIn, connect, user } = useAuth()
const onConnectClick = async () => {
try {
await connect();
} catch (err) {
console.log({ err });
// Handle error
}
};
if (loading) {
return <p>Loading...</p>;
}
if (!isLoggedIn) {
return (
<button onClick={onConnectClick}>
Connect
</button>
);
}
return <Info info={user} />;
}
export default App
useAuth
return type
type AuthContextType = {
loading: boolean;
connect: () => Promise<EthereumProvider>;
loginWithLink: (p: string) => Promise<EthereumProvider>;
loginWithSocial: (p: string) => Promise<EthereumProvider>;
logout: () => void;
isLoggedIn: boolean;
availableLogins: Logins[];
provider: EthereumProvider;
user: UserInfo | null;
theme: "dark" | "light";
logo: string
};
App.js
import { Auth } from "@arcana/auth-react";
function App() {
const { isLoggedIn, user } = useAuth()
if (!isLoggedIn) {
return <Auth theme="light" />;
}
return <Info info={user} />;
}
export default App;
FAQs
Auth component & hooks for Arcana login handling
The npm package @arcana/auth-react receives a total of 70 weekly downloads. As such, @arcana/auth-react popularity was classified as not popular.
We found that @arcana/auth-react demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 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
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.