Universal.Operative.Sdk.WhatsApp
3.0.0
dotnet add package Universal.Operative.Sdk.WhatsApp --version 3.0.0
NuGet\Install-Package Universal.Operative.Sdk.WhatsApp -Version 3.0.0
<PackageReference Include="Universal.Operative.Sdk.WhatsApp" Version="3.0.0" />
<PackageVersion Include="Universal.Operative.Sdk.WhatsApp" Version="3.0.0" />
<PackageReference Include="Universal.Operative.Sdk.WhatsApp" />
paket add Universal.Operative.Sdk.WhatsApp --version 3.0.0
#r "nuget: Universal.Operative.Sdk.WhatsApp, 3.0.0"
#:package Universal.Operative.Sdk.WhatsApp@3.0.0
#addin nuget:?package=Universal.Operative.Sdk.WhatsApp&version=3.0.0
#tool nuget:?package=Universal.Operative.Sdk.WhatsApp&version=3.0.0
About
Universal.Operative.Sdk.WhatsApp provides acknowledged WhatsApp text and file messaging tools for Universal.Operative.Sdk.
The connection lifetime is selected independently:
TransientWhatsAppSessionProviderconnects and disconnects around every invocation.PersistentWhatsAppSessionProviderconnects lazily and remains connected until disposed.ConnectedWhatsAppSessionProviderborrows a client whose lifetime is managed by the host.
Each tool call supplies its recipient in one of these forms:
- An international phone number containing digits only, including the country code:
15551234567. Do not include a leading+, spaces, or punctuation. - A user JID:
15551234567@s.whatsapp.net. - A group JID:
120363000000000@g.us.
Consumers can replace IWhatsAppRecipientResolver to apply aliases, allowlists, blocklists, directory lookup, or another application-specific policy.
Installation
dotnet add package Universal.Operative.Sdk.WhatsApp
Usage
using Universal.Operative.Sdk.Tools;
using Universal.Operative.Sdk.WhatsApp;
using Universal.Meta.WhatsApp.Client.Authentication;
FileWhatsAppAuthenticationStore store = new FileWhatsAppAuthenticationStore(authenticationPath);
using TransientWhatsAppSessionProvider sessions = new TransientWhatsAppSessionProvider(store);
IReadOnlyList<ITool> tools = WhatsAppTools.Create(sessions);
The model calls the tool with both values:
{ "recipient": "15551234567", "message": "Are you coming tomorrow?" }
Files use a separate tool call:
{ "recipient": "15551234567", "file_path": "C:\\Reports\\report.pdf", "caption": "Latest report" }
WhatsAppSendFileTool infers common image, audio, video, and MIME types; unknown extensions are sent as documents. Its IWhatsAppFileAccess dependency can be replaced by consumers that need sandboxing, virtual storage, allowlists, or audit checks.
The authentication store must contain an already-paired linked-device identity. The tool does not pair accounts or expose credentials to the model.
Connection timeouts cover transport opening, handshake, and authentication. Failed persistent initialization disposes the failed client; a later call creates a fresh client. Caller cancellation remains cancellation, while expiration of the configured connection deadline raises TimeoutException. Connection and acknowledgement timeouts must be positive and at most 4,294,967,294 milliseconds; invalid configuration is rejected before connection or sending.
License
Free for noncommercial use under the Universal.Operative Noncommercial License. Source is closed; commercial use requires a separate license from Andrew Ong.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. net11.0 is compatible. |
-
net10.0
- Universal.Meta.WhatsApp.Client (>= 1.0.0)
- Universal.Operative.Sdk (>= 7.0.0)
-
net11.0
- Universal.Meta.WhatsApp.Client (>= 1.0.0)
- Universal.Operative.Sdk (>= 7.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Targets .NET 10 and .NET 11; removes .NET 8 support. Connection deadlines include the handshake; failed persistent initialization releases its client. Invalid JIDs and unsupported timeout values are rejected before sending.