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

omnichannel-service

v1.0.8

Published

SDK para integração com provedores omnichannel (Infobip, Ires, etc.)

Downloads

44

Readme

📖 Omnichannel Service SDK

📌 Descrição

O Omnichannel Service é um SDK em TypeScript que centraliza integrações omnichannel, começando pela Infobip.

Com ele, você pode acessar recursos de People, Conversations, WhatsApp e Email de forma simples e padronizada:

import omni from "omnichannel-service";

const infobip = omni.newInstance.Infobip({
  baseURL: process.env.INFOBIP_URL,
  apiKey: process.env.INFOBIP_API_KEY,
});

// Exemplo: criar uma pessoa
await infobip.people.createPerson({
  firstName: "João",
  lastName: "Silva",
  phone: "5511999999999",
});

⚙️ Instalação

Instale via npm:

npm install omnichannel-service

Ou utilizando o yarn

yarn add omnichannel-service

🚀 Exemplos de Uso

Infobip

🔹 People

// Criar uma pessoa
await infobip.people.createPerson({
  firstName: "João",
  lastName: "Silva",
  phone: "5511999999999",
});

// Atualizar pessoa
await infobip.people.updatePerson("5511999999999", {
  firstName: "João Pedro",
});

// Adicionar tag
await infobip.people.addTag("5511999999999", "VIP");

// Buscar pessoa
await infobip.people.getPerson("5511999999999");

🔹 Conversation

// Criar nota em uma conversa
await infobip.conversation.createNote({
  agentId: "12345",
  conversationId: "abc123",
  content: "Cliente solicitou informações adicionais.",
});

// Fechar conversa
await infobip.conversation.closeConversation("abc123", "Atendimento finalizado.");

// Alterar fila
await infobip.conversation.changeQueue("abc123", {
  queueId: "queue001",
  summary: "Encaminhado para fila de suporte nível 2",
});

🔹 Email

// Enviar e-mail
await infobip.email.sendEmailMessage(
  ["[email protected]"],
  {
    sender: "[email protected]",
    subject: "Confirmação de consulta",
    text: "Sua consulta está confirmada para amanhã às 14h.",
  }
);

// Validar e-mail
await infobip.email.validateEmailAddress("[email protected]");

🔹 WhatsApp

// Enviar mensagem com template
await infobip.whatsapp.sendTemplateMessage(
  {
    templateName: "exame_confirmado",
    sender: "5511999999999",
    to: "5511888888888",
  },
  {
    body: { placeholders: ["Alice", "20/09/2025 às 10h"] },
  }
);

// Enviar template dentro de uma conversa
await infobip.whatsapp.sendConversationTemplateMessage(
  "agent123",
  {
    templateName: "documentos_pendentes",
    sender: "5511999999999",
    to: "5511888888888",
  },
  {
    header: { type: "DOCUMENT", url: "https://link.com/file.pdf", filename: "documento.pdf" },
    body: { placeholders: ["Alice"] },
  }
);

Ires

🔹 whatsapp

import omni from "omnichannel-service"

const ires = omni.newInstance.Ires({
  baseUrl: "https://waba.360dialog.io",
  apiKey: process.env.D360_API_KEY!,
  namespace: process.env.D360_NAME_SPACE!,
});

 const components = [
          {
            type: "body",
            parameters: [
              {
                type: "text",
                text: "Seu João",
              },
              {
                type: "text",
                text: "bom dia",
              },
            ]
          }
 ]

// envio de mensagem via template
await ires.whatsapp.sendMessageTemplate(
"5571999999999",
"template",
"namespace",
components,
"https://image.jpeg"
);

🔧 Serviços e Métodos Disponíveis

Infobip

People

  • addTag(contactId: string, tagName: string)
  • createPerson(peopleData: any)
  • updatePerson(contactId: string, peopleData: any)
  • getPerson(contactId: string)

conversation

  • createNote({agentId, conversationId, content}: {agentId: string; conversationId: string; content: string})
  • getConversation(conversationId: string)
  • closeConversation(conversationId: string, summary: string)
  • changeQueue(conversationId: string, {queueId, topic, summary, priority}: {queueId: string; topic?: string; summary?: string; priority?: number})
  • unassignAgent(conversationId: string)
  • getRecordingMetadata(conversationId?: string)
  • getMessages(conversationId: string, limit?: number, createdBefore?: string, createdAfter?: string)

Whatsapp

  • sendTemplateMessage(whatsappConfig: TWhatsappConfig, templateData: TemplateData)
  • sendConversationTemplateMessage(agentId: string, whatsappConfig: TWhatsappConfig, templateData: TemplateDataConversation)

Email

  • sendEmailMessage(to: string[], {sender, subject, text}: {sender: string; subject: string; text: string})
  • validateEmailAddress(email: string)

Ires

Whatsapp

  • sendMessageTemplate(to: string, template: string, namespace: string, components: any[], image?: string)