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

vestule-mail

v1.0.0

Published

Cliente oficial da API Vestule para Node.js - Sistema de email marketing

Readme

Vestule Mail

Cliente oficial da API Vestule para Node.js. Envie emails facilmente com o sistema de email marketing Vestule.

Instalação

npm install vestule-mail

Ou com yarn:

yarn add vestule-mail

Começe em segundos

import VestuleMail from 'vestule-mail';

const vestule = new VestuleMail({
  apiKey: 'sua-chave-de-api-aqui'
});

// Enviar email simples
await vestule.send(
  '[email protected]',
  'Assunto do email',
  '<h1>Olá!</h1><p>Este é um email de teste.</p>'
);

// Testar conexão
const isConnected = await vestule.test();
console.log('Conectado:', isConnected);

Gerenciamento de Contatos

Listar Contatos

// Listar todos os contatos
const contacts = await vestule.getContacts();

// Listar contatos com parâmetros
const contacts = await vestule.getContacts({
  list_id: 1,
  limit: 50,
  start_from: 0
});

Criar Contato

const newContact = await vestule.createContact({
  email: '[email protected]',
  list_id: 1,
  custom_fields: {
    nome: 'João Silva',
    telefone: '11999999999'
  }
});

Atualizar Contato

const updatedContact = await vestule.updateContact(123, {
  custom_fields: {
    nome: 'João Santos'
  }
});

Deletar Contato

const result = await vestule.deleteContact(123);
console.log(result.message); // "Contato deletado com sucesso"

Gerenciamento de Listas

Listar Listas

const lists = await vestule.getLists();

Criar Lista

const newList = await vestule.createList({
  name: 'Newsletter Principal',
  description: 'Lista principal de newsletter',
  is_active: true
});

Atualizar Lista

const updatedList = await vestule.updateList(1, {
  name: 'Newsletter Atualizada'
});

Gerenciamento de Campanhas

Listar Campanhas

const campaigns = await vestule.getCampaigns({
  status: 'active',
  limit: 20
});

Criar Campanha

const newCampaign = await vestule.createCampaign({
  name: 'Campanha de Boas-vindas',
  subject: 'Bem-vindo à nossa newsletter!',
  broadcast_id: 1,
  template_id: 2,
  tracking_enabled: true,
  open_tracking: true,
  click_tracking: true
});

Obter Estatísticas da Campanha

const stats = await vestule.getCampaignStats(123);
console.log(`Taxa de abertura: ${stats.open_rate}%`);
console.log(`Taxa de cliques: ${stats.click_rate}%`);

Gerenciamento de Templates

Listar Templates

const templates = await vestule.getTemplates({
  type: 'email'
});

Criar Template

const newTemplate = await vestule.createTemplate({
  name: 'Template de Boas-vindas',
  subject: 'Bem-vindo {{nome}}!',
  content: '<h1>Olá {{nome}}!</h1><p>Obrigado por se inscrever.</p>',
  type: 'email'
});

Campos Personalizados

Listar Campos Personalizados

const customFields = await vestule.getCustomFields();

Criar Campo Personalizado

const newField = await vestule.createCustomField({
  name: 'telefone',
  type: 'text',
  is_required: false
});

Grupos

Listar Grupos

const groups = await vestule.getGroups();

Criar Grupo

const newGroup = await vestule.createGroup({
  name: 'Clientes VIP',
  type: 'premium',
  is_active: true
});

Tratamento de Erros

try {
  const contacts = await vestule.getContacts();
} catch (error) {
  if (error.status === 401) {
    console.log('Chave de API inválida');
  } else if (error.status === 403) {
    console.log('API desabilitada');
  } else {
    console.log('Erro:', error.message);
  }
}

Configurações Avançadas

Configurar Timeout

const vestule = new VestuleClient({
  apiKey: 'sua-chave-de-api',
  timeout: 60000 // 60 segundos
});

Alterar Chave de API

vestule.setApiKey('nova-chave-de-api');

Alterar URL Base

vestule.setBaseUrl('https://meu-dominio.com/api');

Tipos TypeScript

Este pacote inclui definições de tipos TypeScript completas:

import VestuleClient, { Contact, Campaign, Template } from 'vestule-api-client';

const vestule = new VestuleClient({
  apiKey: 'sua-chave-de-api'
});

const contact: Contact = await vestule.getContact(123);

Recursos

  • ✅ Gerenciamento completo de contatos
  • ✅ Gerenciamento de listas
  • ✅ Gerenciamento de campanhas
  • ✅ Gerenciamento de templates
  • ✅ Campos personalizados
  • ✅ Grupos de contatos
  • ✅ Estatísticas de campanhas
  • ✅ Tratamento de erros robusto
  • ✅ Suporte completo ao TypeScript
  • ✅ Logs detalhados para debugging

Suporte

Para suporte e documentação completa, visite: https://vestule.com/docs/api

Licença

MIT