Security News
CISA Brings KEV Data to GitHub
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
@viral-loops/widgets
Advanced tools
> This repo is in beta, if you find any bugs please contact our support!
This repo is in beta, if you find any bugs please contact our support!
npm install @viral-loops/widgets
// App.jsx
import { useState, useEffect } from 'react';
import logo from './assets/react.svg';
import './App.css';
import { ViralLoopsWidget, getCampaign } from '@viral-loops/widgets/dist/react';
function App() {
const [vlUser, setVlUser] = useState();
const VIRAL_LOOPS_CAMPAIGN_ID = 'iev8dcEBHtsNToNqaCGnXGGCmsc'; // replace with your campaign ID
async function logout() {
const campaign = await getCampaign(VIRAL_LOOPS_CAMPAIGN_ID);
campaign?.logout();
window.location.reload();
}
async function bindViralLoopsUser() {
if (vlUser) return;
const campaign = await getCampaign(VIRAL_LOOPS_CAMPAIGN_ID);
const loggedInUser = campaign.getUser();
if (loggedInUser) {
console.log('[Viral Loops] user logged in to viral loops is:', loggedInUser);
setVlUser(loggedInUser);
} else {
campaign.on('participation', (vlUser) => {
console.log('[Viral Loops] user participated to viral loops!', vlUser);
setVlUser(vlUser);
});
}
}
useEffect(() => {
bindViralLoopsUser();
});
return (
<>
<div className="App">
<img src={logo} alt="" />
<h1> The Company Name </h1>
<div className="card">
<ViralLoopsWidget ucid={VIRAL_LOOPS_CAMPAIGN_ID} />
{vlUser && (
<div>
<h2>
{' '}
You're logged in as
<span> {vlUser.email} </span>
</h2>
<p> Invite your friends! (You currently have {vlUser.referralCount} referrals) </p>
<button onClick={() => logout()}> Logout </button>
</div>
)}
</div>
</div>
</>
);
}
FAQs
> This repo is in beta, if you find any bugs please contact our support!
The npm package @viral-loops/widgets receives a total of 2,376 weekly downloads. As such, @viral-loops/widgets popularity was classified as popular.
We found that @viral-loops/widgets demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.