
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.
@quotientjs/react
Advanced tools
React provider for the Quotient SDK client.
npm install @quotientjs/react
# or
yarn add @quotientjs/react
# or
pnpm add @quotientjs/react
Wrap your application with the QuotientProvider
:
import { QuotientProvider } from "@quotientjs/react";
function App() {
return (
<QuotientProvider
clientOptions={{
apiKey: "your_api_key",
baseUrl: "https://api.quotient.com",
}}
// Automatically track page views on initial load and route changes
autoTrackPageViews={true}
>
<YourApp />
</QuotientProvider>
);
}
Access the Quotient client with the useQuotient
hook:
import { useQuotient } from "@quotientjs/react";
function YourComponent() {
// Get the client context - includes all needed functionality
const { client, isInitializing, error, reset, trackPageView } = useQuotient();
// Example: manually track page view
const handleTrackPageView = () => {
trackPageView();
};
// Example: track a person
const handleSubmit = async (email) => {
if (client) {
await client.people.upsert({
emailAddress: email,
emailMarketingState: "SUBSCRIBED",
});
}
};
return (
<div>
{isInitializing ? (
<p>Initializing client...</p>
) : error ? (
<p>Error: {error.message}</p>
) : (
<p>Client ready!</p>
)}
<button onClick={handleTrackPageView}>Track Page View</button>
<button onClick={reset}>Reset Client</button>
</div>
);
}
When autoTrackPageViews
is enabled, the provider will:
This is ideal for Single Page Applications where you want analytics for each virtual page.
For components that only need to know the client status:
import { useQuotientStatus } from "@quotientjs/react";
function ClientStatus() {
// Get just the client status without the client itself
const { isInitializing, error } = useQuotientStatus();
return (
<div>
{isInitializing
? "Initializing..."
: error
? `Error: ${error.message}`
: "Ready"}
</div>
);
}
If you need to initialize the client manually:
import { QuotientProvider, useQuotient } from "@quotientjs/react";
function App() {
return (
<QuotientProvider
clientOptions={{
apiKey: "your_api_key",
baseUrl: "https://api.quotient.com",
}}
autoInitialize={false}
>
<InitializeButton />
</QuotientProvider>
);
}
function InitializeButton() {
const { initialize, isInitializing, client } = useQuotient();
return (
<div>
{client ? (
<p>Client initialized!</p>
) : (
<button onClick={initialize} disabled={isInitializing}>
{isInitializing ? "Initializing..." : "Initialize Client"}
</button>
)}
</div>
);
}
MIT
FAQs
React provider for the Quotient SDK client.
The npm package @quotientjs/react receives a total of 90 weekly downloads. As such, @quotientjs/react popularity was classified as not popular.
We found that @quotientjs/react 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.