
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
@rownd/convex
Advanced tools
A React integration between Rownd authentication and Convex backend.
npm install @rownd/convex @rownd/react convex
Create a convex/auth.config.js
file in your project:
export default {
providers: [
{
domain: "https://api.rownd.io",
applicationID: ["app:YOUR_ROWND_APP_ID"], // Replace with your Rownd app ID
},
],
};
Wrap your app with the RowndProvider
from @rownd/convex/react
:
import { createRoot } from "react-dom/client";
import { ConvexReactClient } from "convex/react";
import { RowndProvider } from "@rownd/convex/react";
const convex = new ConvexReactClient(import.meta.env.VITE_CONVEX_URL);
createRoot(document.getElementById("root")!).render(
<RowndProvider
client={convex}
appKey="YOUR_ROWND_APP_KEY" // Replace with your Rownd app key
>
<App />
</RowndProvider>
);
Create a custom hook to store the authenticated user in your Convex database:
import { useRownd } from "@rownd/react";
import { useConvexAuth } from "convex/react";
import { useEffect, useState } from "react";
import { useMutation } from "convex/react";
import { api } from "../convex/_generated/api";
import { Id } from "../convex/_generated/dataModel";
export function useStoreUserEffect() {
const { isLoading, isAuthenticated } = useConvexAuth();
const { user } = useRownd();
const [userId, setUserId] = useState<Id<"users"> | null>(null);
const storeUser = useMutation(api.users.store);
useEffect(() => {
if (!isAuthenticated) {
return;
}
async function createUser() {
const id = await storeUser();
setUserId(id);
}
createUser().catch(console.error);
return () => setUserId(null);
}, [isAuthenticated, storeUser, user?.data.user_id]);
return {
isLoading: isLoading || (isAuthenticated && userId === null),
isAuthenticated: isAuthenticated && userId !== null,
};
}
The useStoreUserEffect
hook provides authentication state that you can use throughout your application:
function App() {
const { isLoading, isAuthenticated } = useStoreUserEffect();
if (isLoading) {
return <div>Loading...</div>;
}
if (!isAuthenticated) {
return <div>Please log in</div>;
}
return <div>Welcome to your authenticated app!</div>;
}
Prop | Type | Description |
---|---|---|
client | ConvexReactClient | Your Convex client instance |
appKey | string | Your Rownd app key |
Returns an object with:
isLoading
: boolean - Whether the authentication state is being determinedisAuthenticated
: boolean - Whether the user is authenticated and stored in ConvexFAQs
Rownd authentication with Convex
The npm package @rownd/convex receives a total of 0 weekly downloads. As such, @rownd/convex popularity was classified as not popular.
We found that @rownd/convex demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 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
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.