npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@djangocfg/ext-leads

v1.0.29

Published

Lead management and contact forms extension for DjangoCFG

Readme

DjangoCFG Extension Preview

View in MarketplaceDocumentationGitHub

@djangocfg/ext-leads

Lead capture extension with ready-to-use contact forms for DjangoCFG.

Part of DjangoCFG — modern Django framework for production-ready SaaS applications.

Features

  • Contact Form - Ready-to-use form with validation and localStorage draft
  • Contact Page - Full-page layout with form, contact info, and Calendly integration
  • API Integration - Submits leads to DjangoCFG backend via Next.js API route
  • Customizable - Override texts, styling, and callbacks

Install

pnpm add @djangocfg/ext-leads

Usage

ContactPage (Recommended)

Full contact page with form, contact details, and optional Calendly booking.

'use client';

import { ContactPage } from '@djangocfg/ext-leads/hooks';

export default function Contact() {
  return (
    <ContactPage
      email="[email protected]"
      whatsapp="+1 234 567 890"
      calendlyUrl="https://calendly.com/your-link"
      title="Get in Touch"
      subtitle="We'd love to hear from you."
      onSuccess={(result) => console.log('Lead created:', result.lead_id)}
    />
  );
}

ContactForm (Standalone)

Just the form component, wrapped in a card.

'use client';

import { ContactForm } from '@djangocfg/ext-leads/hooks';

export default function ContactSection() {
  return (
    <ContactForm
      onSuccess={(result) => console.log('Submitted:', result)}
      onError={(error) => console.error('Failed:', error)}
    />
  );
}

Custom Form with Provider

For full control, use the provider and hook directly.

'use client';

import { ContactFormProvider, useContactForm } from '@djangocfg/ext-leads/hooks';
import type { LeadSubmissionRequest } from '@djangocfg/ext-leads';

function MyCustomForm() {
  const { submit, isSubmitting, error } = useContactForm();

  const handleSubmit = async (e: React.FormEvent<HTMLFormElement>) => {
    e.preventDefault();
    const formData = new FormData(e.currentTarget);

    const data: LeadSubmissionRequest = {
      name: formData.get('name') as string,
      email: formData.get('email') as string,
      message: formData.get('message') as string,
      company: formData.get('company') as string,
      subject: formData.get('subject') as string,
    };

    const result = await submit(data);
    console.log('Lead ID:', result.lead_id);
  };

  return (
    <form onSubmit={handleSubmit}>
      <input name="name" placeholder="Name" required />
      <input name="email" type="email" placeholder="Email" required />
      <input name="company" placeholder="Company" />
      <input name="subject" placeholder="Subject" />
      <textarea name="message" placeholder="Message" required />
      <button type="submit" disabled={isSubmitting}>
        {isSubmitting ? 'Sending...' : 'Send'}
      </button>
      {error && <p>{error.message}</p>}
    </form>
  );
}

export default function Page() {
  return (
    <ContactFormProvider>
      <MyCustomForm />
    </ContactFormProvider>
  );
}

API Reference

Components

| Component | Description | |-----------|-------------| | ContactPage | Full contact page with form and contact info | | ContactForm | Standalone contact form with card wrapper | | ContactInfo | Contact details display component |

Hooks

| Hook | Description | |------|-------------| | useContactForm() | Access form context (submit, isSubmitting, error) | | useContactFormOptional() | Same as above, returns null outside provider |

Types

interface LeadSubmissionRequest {
  name: string;
  email: string;
  message: string;
  company?: string;
  subject?: string;
  site_url?: string;
  // ... additional optional fields
}

interface LeadSubmissionResponse {
  success: boolean;
  message: string;
  lead_id?: number;
}

ContactPageProps

| Prop | Type | Default | Description | |------|------|---------|-------------| | email | string | '[email protected]' | Contact email | | whatsapp | string | '+1 234 567 890' | WhatsApp number | | calendlyUrl | string | - | Calendly booking link | | title | ReactNode | 'Get in Touch' | Page title | | subtitle | string | - | Page subtitle | | location | string | 'Remote-first team' | Location text | | hideCalendly | boolean | false | Hide Calendly card | | onSuccess | (result) => void | - | Success callback |

ContactFormProps

| Prop | Type | Default | Description | |------|------|---------|-------------| | texts | ContactFormTexts | - | Override form texts | | showCard | boolean | true | Show card wrapper | | resetOnSuccess | boolean | true | Clear form after submit | | onSuccess | (result) => void | - | Success callback | | onError | (error) => void | - | Error callback |

Next.js API Route

Create /app/api/contact/route.ts to proxy requests to your backend:

import { NextResponse } from 'next/server';

export async function POST(request: Request) {
  const body = await request.json();
  const { _apiUrl, ...data } = body;

  const apiUrl = _apiUrl || process.env.API_URL;

  const response = await fetch(`${apiUrl}/api/ext_leads/leads/submit/`, {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify(data),
  });

  const result = await response.json();
  return NextResponse.json(result, { status: response.status });
}

License

MIT

Links