WhatsApp Client

approvedunreviewed

by cordelia242

WhatsApp client for Obsidian (Evolution API) with customer and order workflows.

↓ 30 downloadsUpdated 17d agoMIT

WhatsApp Client

Obsidian plugin for a retail sales vault. It embeds a WhatsApp client (through Evolution API 2.3.x) and replaces the Templater templates with plugin commands. Works on desktop, phones and tablets.

Install

pnpm install
pnpm run deploy      # builds and copies main.js, manifest.json, styles.css into the vault

The vault defaults to ../Complices; set OBSIDIAN_VAULT=/path/to/vault to use another one. Then enable WhatsApp Client in Settings → Community plugins.

Settings

SettingMeaning
URL del servidor, Instancia, API keyEvolution API connection. "Probar" checks the instance state.
Código de paísPrepended to local phones (70000001 → 59170000001) to match chats with customers. Default 591.
Actualizar chats cadaPolling interval while the WhatsApp view is open (minimum 5 s).
QR de pagoVault image sent by Enviar QR.
Texto que acompaña al QROptional caption; {nombre} becomes the customer's name.

The API key is stored in the plugin's data.json. If the vault is synced (Self-hosted LiveSync), enable end-to-end encryption.

Commands

  • Abrir WhatsApp (also the ribbon icon): chat list, conversation and contact panel. On narrow screens one pane is shown at a time.
  • Nuevo cliente, Nuevo pedido, Nueva prenda, Nuevo fardo: write the same notes the old templates wrote.

WhatsApp view

  • Chats refresh every N seconds only while the view is open. Images load on demand and are kept in memory, never written to the vault.
  • Adjuntar (paperclip): send an image from the device (gallery or camera on mobile) or from the vault. The text in the message box is sent as its caption.
  • Contact panel, chosen by the chat's phone:
    • Not a customer: Crear cliente (name and phone prefilled) or Vincular a cliente existente (stores this phone on that customer, asking before replacing another phone).
    • Customer: Nuevo pedido (customer fixed), Enviar QR, and the customer's orders.
  • Chats with a LID (…@lid, WhatsApp's anonymous identifier) use the phone in remoteJidAlt when WhatsApp shares it. When it does not, creating or linking the customer stores the LID in the WhatsApp LID property, so the chat recognizes the customer afterwards.
  • Nothing is written to the vault automatically: every note is created by a button, so several synced devices never create duplicates.

Development

pnpm test            # domain tests (vitest)
pnpm lint            # eslint with eslint-plugin-obsidianmd (same rules as the community review)
pnpm build           # typecheck + production bundle
pnpm dev             # watch mode

Releasing

Bump version in manifest.json and package.json, commit, then push a tag with exactly that version (git tag 0.2.0 && git push origin 0.2.0). The Release workflow lints, tests, builds, attests the build provenance of main.js, manifest.json and styles.css, and publishes the GitHub release that BRAT installs.

Domain services (src/customers, src/orders, src/catalog) depend only on VaultPort; the Evolution client depends only on HttpPort. Obsidian adapters live in src/shared/obsidian-vault.ts and src/whatsapp/obsidian-http.ts.

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.