
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@businessflow/leads
Advanced tools
Marketing website lead collection and form submission utilities with server-side API route handlers for BusinessFlow CRM
Marketing website lead collection and form submission utilities for React and NextJS applications that integrate with BusinessFlow CRM.
npm install @businessflow/marketing-sites
// app/api/lead/route.ts
import { createBusinessFlowHandler } from '@businessflow/marketing-sites/server';
export const POST = createBusinessFlowHandler({
apiUrl: process.env.BUSINESS_FLOW_API_URL!,
apiKey: process.env.BUSINESS_FLOW_API_KEY!,
sourceUrl: process.env.SITE_URL!,
recaptchaSecret: process.env.RECAPTCHA_SECRET_KEY!,
});
// app/api/lead/route.ts
import { createSimpleBusinessFlowHandler } from '@businessflow/marketing-sites/server';
// Uses BUSINESS_FLOW_API_URL, BUSINESS_FLOW_API_KEY, and RECAPTCHA_SECRET_KEY from env
export const POST = createSimpleBusinessFlowHandler();
// app/api/lead/route.ts
import { createLeadHandler } from '@businessflow/marketing-sites/server';
export const POST = createLeadHandler({
onSubmit: async (data) => {
// Your custom business logic here
const response = await fetch('https://your-api.com/leads', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.YOUR_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify(data)
});
return {
success: response.ok,
message: response.ok ? 'Lead submitted successfully' : 'Submission failed',
id: response.ok ? await response.json().then(r => r.id) : undefined
};
},
recaptcha: {
secretKey: process.env.RECAPTCHA_SECRET_KEY!
}
});
import { ContactForm } from '@businessflow/leads/react';
export default function ContactPage() {
return (
<ContactForm
recaptcha={{ siteKey: process.env.NEXT_PUBLIC_RECAPTCHA_SITE_KEY! }}
onSuccess={(response) => console.log('Success!', response)}
onError={(error) => console.error('Error:', error)}
/>
);
}
import { useContactForm } from '@businessflow/leads/react';
export default function CustomContactForm() {
const {
formData,
errors,
state,
handleChange,
handleSubmit,
handleRetry,
resetForm
} = useContactForm({
endpoint: '/api/lead',
recaptcha: {
siteKey: process.env.NEXT_PUBLIC_RECAPTCHA_SITE_KEY!,
action: 'contact_form'
},
onSuccess: (response) => console.log('Success!', response),
onError: (error) => console.error('Error:', error),
maxRetries: 3
});
return (
<form onSubmit={(e) => { e.preventDefault(); handleSubmit(); }}>
<input
type="text"
placeholder="First Name"
value={formData.firstName}
onChange={(e) => handleChange('firstName', e.target.value)}
/>
{errors.firstName && <span>{errors.firstName}</span>}
<input
type="text"
placeholder="Last Name"
value={formData.lastName}
onChange={(e) => handleChange('lastName', e.target.value)}
/>
{errors.lastName && <span>{errors.lastName}</span>}
<input
type="email"
placeholder="Email"
value={formData.email}
onChange={(e) => handleChange('email', e.target.value)}
/>
{errors.email && <span>{errors.email}</span>}
<button type="submit" disabled={state.isSubmitting}>
{state.isSubmitting ? 'Submitting...' : 'Submit'}
</button>
{state.error && state.canRetry && (
<button onClick={handleRetry} disabled={state.isSubmitting}>
Retry ({state.retryCount}/{3})
</button>
)}
{state.isSuccess && <div>Form submitted successfully!</div>}
{state.error && <div>Error: {state.error}</div>}
</form>
);
}
MIT
FAQs
Marketing website lead collection and form submission utilities with server-side API route handlers for BusinessFlow CRM
We found that @businessflow/leads demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.