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

crm-mktg-sdk

v1.1.0

Published

SDK de marketing para CRM: email, sms, automatización, IA, formularios y más

Readme

Landing Pages Module

El submódulo landingPages de este SDK permite crear, configurar, publicar y medir landing pages de forma programática, orquestando IA, formularios, hosting y analítica.

Instalación

Si aún no lo has hecho, instala el SDK y sus dependencias:

npm install crm-mktg-sdk
npm install axios
Importación
ts
Copiar
Editar
import {
  listLandingTemplates,
  createLandingTemplate,
  getLandingBlocks,
  generateLandingCopy,
  createLandingPage,
  updateLandingPage,
  previewLandingPage,
  publishLandingPage,
  listLandingPages,
  getLandingStats,
  createLandingVariant,
  getAbTestResults
} from "crm-mktg-sdk/landingPages";

import { getHttpClient } from "crm-mktg-sdk/client";
// Asegúrate de configurar process.env.API_URL con la URL de tu API
Uso Básico
1. Listar Plantillas
ts
Copiar
Editar
const templates = await listLandingTemplates();
console.log("Plantillas disponibles:", templates);
2. Obtener Bloques
ts
Copiar
Editar
const blocks = await getLandingBlocks();
console.log("Bloques configurables:", blocks);
3. Generar Copy con IA
ts
Copiar
Editar
const copy = await generateLandingCopy({
  prompt: "Landing page para webinar de marketing",
  tone: "persuasivo",
  keywords: ["webinar", "marketing"]
});
console.log("Copy generado:", copy);
// { title, subtitle, ctaText }
4. Crear Landing (Draft)
ts
Copiar
Editar
const draft = await createLandingPage({
  name: "Nueva Promoción",
  templateId: "tpl-producto",
  blocksConfig: [
    { type: "hero", position: 1, settings: { title: copy.title, ctaText: copy.ctaText, ctaUrl: "https://..." } },
    // ...
  ],
  domainOptions: {
    hostname: "promo.midominio.com",
    ssl: true,
    seo: { metaTitle: "Promo", metaDescription: "Oferta especial", metaKeywords: ["promo", "oferta"] }
  }
});
console.log("Landing draft:", draft);
5. Actualizar Landing
ts
Copiar
Editar
const updated = await updateLandingPage(draft.id, {
  name: "Promo Actualizada",
  blocksConfig: [ /* nuevos bloques o ajustes */ ]
});
6. Previsualizar
ts
Copiar
Editar
const { previewUrl } = await previewLandingPage(draft.id);
console.log("Ver preview en:", previewUrl);
7. Publicar o Programar
ts
Copiar
Editar
const result = await publishLandingPage(draft.id, {
  ssl: true,
  seoMeta: { metaTitle: "Promo en Vivo", metaDescription: "...", metaKeywords: ["live"] },
  schedule: { publishDate: new Date("2025-05-10T09:00:00Z") }
});
console.log("Publicado en:", result.publishedUrl);
8. Listar Landings
ts
Copiar
Editar
const all = await listLandingPages({ status: "published" });
console.log("Landings publicadas:", all);
9. Métricas
ts
Copiar
Editar
const stats = await getLandingStats(draft.id, {
  from: new Date("2025-05-01T00:00:00Z"),
  to: new Date()
});
console.log("Métricas:", stats);
10. A/B Testing
ts
Copiar
Editar
// Crear variante
const variant = await createLandingVariant(draft.id, {
  blocksConfig: [ /* variante de bloques */ ]
});

// Obtener reporte
const report = await getAbTestResults("test123");
console.log("Reporte A/B:", report);
Tipos y Contratos
Revisa src/landingPages/types.ts para los detalles de las interfaces:

Template

BlockDefinition

BlockConfig

DomainConfig

LandingPage

Stats

AbTestReport

Buenas Prácticas
Variables de entorno: Define API_URL en tu .env para apuntar a tu API.

Manejo de errores: Captura excepciones de Axios para mostrar mensajes claros al usuario.

Validación previa: Valida que blocksConfig cumpla el JSON Schema de cada bloque antes de enviar.