BccCode.Notifications.Client
4.0.0
dotnet add package BccCode.Notifications.Client --version 4.0.0
NuGet\Install-Package BccCode.Notifications.Client -Version 4.0.0
<PackageReference Include="BccCode.Notifications.Client" Version="4.0.0" />
<PackageVersion Include="BccCode.Notifications.Client" Version="4.0.0" />
<PackageReference Include="BccCode.Notifications.Client" />
paket add BccCode.Notifications.Client --version 4.0.0
#r "nuget: BccCode.Notifications.Client, 4.0.0"
#:package BccCode.Notifications.Client@4.0.0
#addin nuget:?package=BccCode.Notifications.Client&version=4.0.0
#tool nuget:?package=BccCode.Notifications.Client&version=4.0.0
BCC Notifications .NET Client
A clean and simple .NET client for the BCC Notifications API
🚀 Key Features
- Platform-First Architecture: Built on
BccCode.Platform.ApisandBccCode.Platform.Auth - Scope-Based Authentication: Automatic OAuth token management with proper scopes
- Full Feature Support: Email (with attachments), direct email, SMS, and In-App notifications
📦 Installation
dotnet add package BccCode.Notifications.Client
From 4.0 the packages target net10.0 and use BccCode.Platform 2.0. Projects on older frameworks (netstandard, .NET 8, .NET 9) must upgrade to at least the latest LTS.
⚡ Setup
// Standard BCC Platform chain
builder.Services.AddBccPlatform(AppEnvironment.Sandbox, clientId, clientSecret)
.AddBccCoreApiClient(/* scopes */)
.AddBccPubSub()
.AddBccNotifications(); // ← Works exactly the same way
That's it! No configuration options, no overloads, just one simple method.
🔧 Usage
public class EmailService
{
private readonly INotificationClient _notificationClient;
public EmailService(INotificationClient notificationClient)
{
_notificationClient = notificationClient;
}
public async Task SendWelcomeEmail(Guid personUid)
{
var payload = new EmailPayload
{
PersonUid = personUid,
NotificationPayload = new List<EmailContent>
{
new()
{
Language = "en-US",
Subject = "Welcome!",
Title = "Welcome to our service!",
Content = "<h1>Hello [firstName]!</h1><p>Welcome to our service!</p>",
ShowFooter = true // Optional: control footer visibility (default: true)
}
}
};
var response = await _notificationClient.SendEmailAsync(payload);
Console.WriteLine($"Email queued with ID: {response.Id}");
}
}
Sending to an email address directly
When the recipient is not a BCC person, send straight to an email address with
SendEmailDirectAsync. It takes a single EmailContent (no language selection, no
[firstName]/[lastName] token replacement) and returns nothing - the call either
succeeds or throws NotificationApiException.
await _notificationClient.SendEmailDirectAsync(new CreateEmailDirectRequest
{
Email = "someone@example.com",
NotificationPayload = new EmailContent
{
Language = "en-US",
Subject = "Welcome!",
Title = "Welcome to our service!",
Content = "<h1>Hello!</h1><p>Welcome to our service!</p>",
ShowFooter = true
}
});
⚠️ Error Handling
The client provides clear, actionable error messages:
InvalidOperationException: Could not instantiate NotificationClient due to missing credentials.
Call AddBccPlatform(...) in startup to add BCC platform credentials.
🔧 Dependency Graph
BccCode.Notifications.Client v2.2.0
├── BccCode.Platform.Apis (authentication, HTTP management)
├── BccCode.Platform.Config (environment configuration)
└── Microsoft.Extensions.Http (HTTP client factory)
📄 API Reference
Email Notifications
Task<NotificationResponse> SendEmailAsync(EmailPayload payload, bool dryRun = false, CancellationToken cancellationToken = default)
Direct Email Notifications
Task SendEmailDirectAsync(CreateEmailDirectRequest payload, EmailProvider provider = EmailProvider.Default, CancellationToken cancellationToken = default)
Sends to an explicit email address instead of a person, group or filter. There is no
dryRun option and no NotificationResponse - the notification is not tracked, so
delivery statistics cannot be queried afterwards.
SMS Notifications
Task<NotificationResponse> SendSmsAsync(SmsPayload payload, bool dryRun = false, CancellationToken cancellationToken = default)
Native Push Notifications
Task<NotificationResponse> SendNativePushAsync(NativePushPayload payload, bool dryRun = false, CancellationToken cancellationToken = default)
In-App Notifications
Task<NotificationResponse> SendInAppAsync(InAppPayload payload, bool dryRun = false, CancellationToken cancellationToken = default)
🚀 Quick Start
- Install the package with
dotnet add package BccCode.Notifications.Client - Configure BCC Platform (if not already done)
- Add Notifications with
.AddBccNotifications()- no parameters needed! - Inject and use
INotificationClient
| 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. |
-
net10.0
- BccCode.Notifications.Contracts (>= 4.0.0)
- BccCode.Platform.Apis (>= 2.0.0.22)
- BccCode.Platform.Config (>= 2.0.0.22)
- Microsoft.Extensions.Http (>= 10.0.14)
- Newtonsoft.Json (>= 13.0.4)
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 |
|---|---|---|
| 4.0.0 | 47 | 11/6/2026 |
| 3.1.0 | 4,743 | 9/15/2026 |
| 3.0.1 | 2,686 | 5/22/2026 |
| 3.0.0 | 124 | 5/20/2026 |
| 2.3.9 | 121 | 4/30/2026 |
| 2.3.8 | 131 | 4/28/2026 |
| 2.3.7 | 132 | 4/28/2026 |
| 2.3.6 | 371 | 2/23/2026 |
| 2.3.5 | 142 | 2/23/2026 |
| 2.3.4 | 182 | 1/29/2026 |
| 2.3.2 | 3,153 | 6/25/2025 |
| 2.3.1 | 235 | 6/25/2025 |
| 2.2.1 | 304 | 6/24/2025 |
| 2.0.2 | 287 | 6/19/2025 |
| 2.0.1 | 249 | 6/19/2025 |
| 1.0.2 | 401 | 6/12/2025 |
| 1.0.1 | 391 | 6/12/2025 |
| 0.0.0 | 129 | 4/30/2026 |