Baileys.NET 1.9.1

dotnet add package Baileys.NET --version 1.9.1
                    
NuGet\Install-Package Baileys.NET -Version 1.9.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Baileys.NET" Version="1.9.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Baileys.NET" Version="1.9.1" />
                    
Directory.Packages.props
<PackageReference Include="Baileys.NET" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Baileys.NET --version 1.9.1
                    
#r "nuget: Baileys.NET, 1.9.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Baileys.NET@1.9.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Baileys.NET&version=1.9.1
                    
Install as a Cake Addin
#tool nuget:?package=Baileys.NET&version=1.9.1
                    
Install as a Cake Tool

Baileys — WhatsApp Web Library for .NET 10

NuGet License: MIT .NET 10

A .NET 10 port of the Baileys TypeScript library for interacting with the WhatsApp Web API.

Installation

dotnet add package Baileys.NET

Or via the NuGet Package Manager:

Install-Package Baileys.NET

Documentation

Full documentation is available in the docs/ folder:

Guide Description
Getting Started Installation, quick start, first session
Dependency Injection ASP.NET Core / Worker Service integration
Session Storage InMemory, File, and custom DB providers
Cryptography AES-GCM/CBC/CTR, HMAC, HKDF, PBKDF2
JID Utilities Encode, decode, classify JIDs
Auth Utilities Credential init, key generation
WABinary Codec Binary node encoding / decoding
Types Reference All WhatsApp domain types
Events Reference Event payload types
Defaults & Constants Protocol constants, browser presets

Features

  • Binary Protocol Codec — Encode and decode the WhatsApp binary node wire format (WABinary), including zlib decompression
  • Cryptographic Utilities — AES-256-GCM/CBC/CTR, HMAC-SHA-256/512, SHA-256/MD5, HKDF, PBKDF2 — all via System.Security.Cryptography (no third-party deps)
  • JID Utilities — Encode, decode, normalise, and classify JIDs (user, group, broadcast, newsletter, LID, hosted)
  • Auth UtilitiesInitAuthCreds(), Curve25519 key-pair generation, signed pre-key generation
  • Noise Protocol Handler — Noise_XX_25519_AESGCM_SHA256 handshake state machine
  • Complete Type Definitions — All WhatsApp types: Contact, Chat, GroupMetadata, Message, Call, Label, Newsletter, Business, Product, State, Event payloads
  • Signal Key StoreISignalKeyStore interface with in-memory (InMemorySignalKeyStore) and directory-backed (DirectorySignalKeyStore) implementations; typed extension helpers for every Signal data category (pre-key, session, sender-key, app-state-sync, lid-mapping, device-list, tctoken, identity-key)
  • Full Authentication StateAuthenticationState bundles AuthenticationCreds + ISignalKeyStore exactly like the TypeScript AuthenticationState type; LoadAuthStateAsync() extension builds one from any IAuthStateProvider
  • Directory Auth ProviderDirectoryAuthStateProvider stores credentials in creds.json and Signal keys as individual files in one directory, mirroring the TypeScript useMultiFileAuthState(folder) integration pattern
  • Default Constants — WebSocket URL, noise-protocol constants, media HKDF key mappings, browser description presets, timing defaults
  • Structured LoggingILogger interface + NullLogger and ConsoleLogger implementations
  • Dependency InjectionAddBaileys(), AddBaileysWithFileStorage(), AddBaileysWithDirectoryStorage(), AddBaileysWithProvider<T>() helpers
  • Pluggable Session StorageIAuthStateProvider interface with in-memory, file-based, and directory-based implementations
  • Automatic Session InitiationBaileysClient and BaileysClientHostedService automatically manage the WebSocket connection, Noise handshake, and QR code lifecycle

Quick Start

using Baileys;
using Baileys.Types;
using Baileys.Utils;
using Baileys.Extensions;

// ── Dependency injection (Program.cs) ────────────────────────────────────────
// This will automatically initiate a session and print the QR code to the console
// when the application starts.
builder.Services.AddBaileysWithDirectoryStorage(
    directory: "baileys_auth_info",
    configure: o => 
    {
        o.PhoneNumber = "15551234567";
        o.PrintQrInTerminal = true; // Default is true
    });

// ── Manual Connection (optional) ────────────────────────────────────────────
// If you prefer manual control, you can inject BaileysClient:
public class MyService(BaileysClient client)
{
    public async Task StartAsync()
    {
        // Subscribe to events
        client.Ev.On<ConnectionUpdateEvent>("connection.update", update => {
            if(update.Connection == WaConnectionState.Open) {
                Console.WriteLine("Connected!");
            }
        });

        await client.ConnectAsync();
    }
}

Namespace Map

Namespace Contents
Baileys BaileysClient
Baileys.Types All domain types and enums, ISignalKeyStore, SignalDataTypes, AuthenticationState, SignalKeyStoreExtensions, TcToken
Baileys.Utils Crypto, JidUtils, AuthUtils, Generics, NoiseHandler, ILogger
Baileys.WABinary WaBinaryEncoder, WaBinaryDecoder, WaBinaryConstants
Baileys.Defaults BaileysDefaults, Browsers
Baileys.Options BaileysOptions
Baileys.Session IAuthStateProvider, InMemoryAuthStateProvider, FileAuthStateProvider, DirectoryAuthStateProvider, InMemorySignalKeyStore, DirectorySignalKeyStore
Baileys.Extensions ServiceCollectionExtensions, AuthStateExtensions, BaileysClientHostedService
Baileys.Socket BaileysSocket

Requirements

  • .NET 10+
  • Runtime NuGet dependencies: Microsoft.Extensions.DependencyInjection.Abstractions and Microsoft.Extensions.Options

License

MIT — see LICENSE

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.9.1 226 4/25/2026
1.9.0 140 4/24/2026
1.8.0 177 4/10/2026
1.7.0 184 3/16/2026
1.6.0 130 3/15/2026
1.5.0 124 3/14/2026
1.4.0 167 3/13/2026
1.3.0 124 3/13/2026
1.2.0 125 3/13/2026
1.1.1 148 3/11/2026
1.1.0 120 3/11/2026
1.0.0 120 3/11/2026