Webority.Chat.AspNetCore
0.145.2
See the version list below for details.
dotnet add package Webority.Chat.AspNetCore --version 0.145.2
NuGet\Install-Package Webority.Chat.AspNetCore -Version 0.145.2
<PackageReference Include="Webority.Chat.AspNetCore" Version="0.145.2" />
<PackageVersion Include="Webority.Chat.AspNetCore" Version="0.145.2" />
<PackageReference Include="Webority.Chat.AspNetCore" />
paket add Webority.Chat.AspNetCore --version 0.145.2
#r "nuget: Webority.Chat.AspNetCore, 0.145.2"
#:package Webority.Chat.AspNetCore@0.145.2
#addin nuget:?package=Webority.Chat.AspNetCore&version=0.145.2
#tool nuget:?package=Webority.Chat.AspNetCore&version=0.145.2
webority-chat
Conversational component for assistant, support and sales chats: engine, React, Razor and React Native screens, server and admin.
Packages
| Package | Registry | What it holds |
|---|---|---|
@webority/chat-core |
npm | The headless engine: client over the chat routes, session state machine over message parts, stream reader, profile resolution, default labels, fixture client. |
@webority/chat-elements |
npm | <wui-chat> and one element per part kind, the chat styles on @webority/theme tokens, the chat.global.js bundle for Razor pages. |
@webority/chat-react |
npm | The React shells (launcher, docked, full page, embedded), thread, composer, one renderer per part kind and useChat. |
@webority/mobile-chat |
npm | The React Native screen, sheet and embedded shells, renderers and useChat. ChatSheet is a floating launcher that opens the chat in a bottom sheet at 92% of the screen height (snapPoints), closed by a pull down or a tap on the backdrop. |
Webority.Chat |
NuGet | The conversation core: entities, contract records, store, profiles, scripts, inputs, ledger rules, visitors, package-owned schema. |
Webority.Chat.AspNetCore |
NuGet | MapWeborityChat(prefix, options): every route, the SSE writer, the feature filter, the captcha gate. |
Webority.Chat.Ai |
NuGet | The AI responder over Webority.Ai: agent loop, reply guard, presentation tools, guardrails. |
Webority.Chat.Support |
NuGet | Handoff to a person, ticket and handoff parts, open tickets on start, away notices. It serves no page, so a customer head takes it safely. |
Webority.Chat.Support.Admin |
NuGet | The live agent console at /ChatSupport/Live, for the staff head only. |
Webority.Chat.Speech |
NuGet | Azure Speech tokens for dictation and read-aloud. |
Webority.Chat.Sms.Azure |
NuGet | Sends phone one-time codes through Azure Communication Services SMS over managed identity. |
Webority.Chat.Razor |
NuGet | The app-chat tag helper and the chat-elements assets. |
Webority.Chat.Admin |
NuGet | Transcripts, ratings, unanswered questions, leads, profile and script editors. |
Every package carries the one version in version.json.
Voice clips are players of stored clips only: the chat plays a clip that is already stored and does not record one.
A phone app that turns on Dictation or VoiceClips adds expo-audio's config plugin to its own app config, with the microphone permission text (Android RECORD_AUDIO), and ships a new store build.
Server wiring
services.AddWeborityChat<AppDbContext>()
.AddLeadSink<WebsiteLeadSink>();
// OnModelCreating: modelBuilder.ApplyWeborityChatConfiguration();
app.MapWeborityChat("/api/chat", new ChatMapOptions { Surface = "website" });
Seeds are not registered in the web head. A product keeps each seed file in its database project, and a console calls ChatSeedSql.Write, which writes a run-once SQL script. The database project's build calls ChatSeedSql.Check, and the database gate applies each script once per deploy. Raising the seed's Revision re-applies it where the stored revision is lower. See docs/usage/server.md → Set up.
AddWeborityChat sends one-time codes by email, so every host registers Webority.Email, and adds the code template with AddWeborityChatOtpEmailTemplates() on its email builder. A host with lead capture also adds AddWeborityChatSalesEmailTemplates(), the template of the sales email sent to Chat:SalesNotificationEmail for each new lead.
Booking needs the host's IChatBookingSlots and IChatBookingSink, registered before or after AddWeborityChat. A chat whose profile turns booking on logs an error naming the missing seam when either is not registered, and the visitor sees the assistant-unavailable message.
AI replies: services.AddWeborityChatAi(surface, options) screens each message through an AI judge, so the host also registers one, for example AddWeborityAiJudgmentJev() with its key; startup fails without it. The four judgment uses (chat-injection, chat-topic, chat-sentiment, chat-repeat) default to the Jev provider (ChatAiUseDefaults); an Ai:Judgment:Uses entry overrides one.
Captcha: services.AddWeborityChatCaptcha() adds the gate over the host's ICaptchaVerifier (Webority.Security), and the browser receives that verifier's site key, so one stored profile works in every environment. A surface whose profile sets a captcha mode other than Off fails each turn with an error when the host never calls it.
The tables and their numbered migrations ship inside the Webority.Chat package under content/schema.
Admin pages: services.AddRazorPages().AddWeborityChatAdmin("ChatAdmin", leadUrlTemplate: "/Sales/Leads/{lead}", articleSuggestionUrlTemplate: "/Support/HelpCentre/New?question={question}&source={surface}"). The lead template holds {lead} once; the article template holds {question} once and {surface} at most once, and the Unanswered page shows "Suggest an article" only when it is set. Both are optional, and both start with https:// or a single /.
The transcript list is /Chat/Transcripts. Its scope query value, /Chat/Transcripts?scope=<scope key>, shows only the conversations stored under that scope key, matched exactly; the page shows the active scope with a Clear scope link.
Support wiring
Webority.Chat.Support adds handoff to a person, the agent console and away notices. Register it after AddWeborityChat and after the support builder's head call: AddCustomerService() on the customer head, AddAgentService() on the admin head, AddSystemService() on a background worker head.
// Customer head
var support = services.AddWeboritySupport<AppDbContext>().AddCustomerService().AddCustomerSuggestions();
services.AddWeborityAiActions<AppDbContext>(configuration);
support.AddChatTools();
services.AddWeborityChat<AppDbContext>();
services.AddWeborityChatSupport();
// OnModelCreating: modelBuilder.ApplyChatSupportConfiguration();
app.MapWeborityChat("/api/chat", new ChatMapOptions { Surface = "website" }).MapWeborityChatSupport(options);
// Admin head (also references Webority.Chat.Support.Admin)
var mvc = services.AddRazorPages();
services.AddWeboritySupport<AppDbContext>().AddAgentService();
mvc.AddWeborityChatSupportAdmin(agentPolicy);
Staff pages live only in Webority.Chat.Admin and Webority.Chat.Support.Admin. A customer or public head references neither.
Every head that calls AddWeborityChatSupport calls one of two methods on the AddWeborityOutbox builder: AddChatAwayOutbox() on the host that drains the chat-away queue (it sends the email and pushes), or AddChatAwayOutboxWriter() on a head that only queues away notices (no handler, so no push sender). It also sets Chat:Away:ConversationUrlTemplate to an absolute https URL containing {conversationId} when it sets the key. Startup fails otherwise.
- The host lists
SupportTicketRaiseinAi:Actions:KindswithModeConfirm, and gives it a profile action cap (ChatActionCap: kind, max, window hours). The hand-off raises its ticket through that ledger entry. Chat:SupportbindsChatSupportOptions(wait, idle, agent capacity, presence, typing and stream timings, with their ranges).Chat:Awaybinds the away notice options (docs/away-notices.md).- A product timer calls
ChatHandoffDeadlines.RunAsynconce a minute. It ends a hand-off nobody took withinMaxWaitMinutes. - The
ChatHandofftable and its numbered migration ship inside theWebority.Chat.Supportpackage undercontent/schema, and run after theWebority.Chatbaseline. - Away notices need the host's
IChatPushDeviceswhen the recipient has devices, and a one-minute outbox processor for thechat-awayqueue. Seedocs/away-notices.md. - The customer head calls
AddWeborityChatOtpEmailTemplates()on its email builder for the visitor's one-time code (see Server wiring).
Visitors. A visitor's hand-off needs a confirmed email. When none exists, the hand-off asks for a name and an email, confirmed with a one-time code, and answers ChatHandoffStatus.ContactRequested until the contact is confirmed. The ticket is raised as a support contact (realm Contact), and staff see it only then. A host registers no IChatNotificationRecipients class unless it has devices. The customer head still registers ISupportCustomerContext for signed-in users, and it may throw for a public head with none.
Erasure and counts
ChatStore (registered by AddWeborityChat) deletes and counts a product's chat rows. Never query or delete the package's Chat* tables directly.
| Method | What it removes or counts | When to call it |
|---|---|---|
DeleteScopeAsync(scopeKey) |
Every conversation of a tenant on every surface, with attachments and field values. | At tenant erasure. |
DeleteActorAsync(actorReference) |
One person's conversations in every scope. | At a person's erasure. |
DeleteOwnedAsync(surface, actorReference, scopeKey) |
One person's conversations on one surface in one scope. | When their access shrinks. |
DeleteActorPrefixAsync(surface, actorReferencePrefix) |
Every conversation on one surface whose actor reference starts with the prefix. | For a family of actors the product names by a shared prefix, such as everyone who opened one shared link. |
DeleteExpiredAsync() |
Conversations past their surface's retention. | From the product's own timer. |
CountScopeAsync(scopeKey) |
The conversations DeleteScopeAsync would remove. |
For a purge report and a zero-left check. |
CountActorPrefixAsync(surface, actorReferencePrefix) |
The conversations DeleteActorPrefixAsync would remove. |
For a purge report and a zero-left check. |
Each method returns the number of conversations. Messages and input requests go with their conversation. None needs an actor, so call them only from trusted server code.
public static async Task EraseChatAsync(ChatStore chat, string tenantScope, string surface, string linkPrefix, CancellationToken cancellationToken)
{
var tenantFound = await chat.CountScopeAsync(tenantScope, cancellationToken);
var tenantDeleted = await chat.DeleteScopeAsync(tenantScope, cancellationToken);
var tenantLeft = await chat.CountScopeAsync(tenantScope, cancellationToken);
if (tenantDeleted != tenantFound || tenantLeft != 0)
{
throw new InvalidOperationException("Chat rows remain after the tenant erasure.");
}
var familyFound = await chat.CountActorPrefixAsync(surface, linkPrefix, cancellationToken);
var familyDeleted = await chat.DeleteActorPrefixAsync(surface, linkPrefix, cancellationToken);
var familyLeft = await chat.CountActorPrefixAsync(surface, linkPrefix, cancellationToken);
if (familyDeleted != familyFound || familyLeft != 0)
{
throw new InvalidOperationException("Chat rows remain after the shared link erasure.");
}
}
Develop
corepack pnpm install --frozen-lockfile
corepack pnpm -r build
dotnet build Webority.Chat.slnx -v q --nologo -m:4
dotnet test --solution Webority.Chat.slnx --no-build
Two samples run the library locally:
samples/FullStack.Hostruns the whole chat on one machine: the real routes, a SQL Server database, the staff pages and a stand-in model with no network. Start with itsREADME.md.samples/Razor.Sandboxis the database-free catalogue of the Razor chat, which the parity gate boots.
See CLAUDE.md for the repo rules.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- Azure.Identity (>= 1.21.0)
- Microsoft.Agents.AI (>= 1.28.0)
- Microsoft.EntityFrameworkCore.Relational (>= 11.0.0)
- Microsoft.Extensions.Http.Resilience (>= 11.0.0)
- Webority.Ads (>= 0.30.1)
- Webority.Ai (>= 0.61.0)
- Webority.Ai.Actions (>= 0.61.0)
- Webority.Ai.Judgment (>= 0.61.0)
- Webority.Analytics (>= 0.40.3)
- Webority.Azure.Storage (>= 0.40.1)
- Webority.Chat (>= 0.145.2)
- Webority.Delivery.AspNetCore (>= 0.58.0)
- Webority.Delivery.EntityFrameworkCore (>= 0.58.0)
- Webority.Domain.Abstractions (>= 0.20.0)
- Webority.Email (>= 0.88.3)
- Webority.Email.Razor (>= 0.88.3)
- Webority.Security.AspNetCore (>= 0.65.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Webority.Chat.AspNetCore:
| Package | Downloads |
|---|---|
|
Webority.Chat.Support
The support bridge for Webority Chat: handoff from the assistant to a person, ticket and handoff parts, open tickets on start and away notifications, over Webority.Support. It serves no staff page; the agent console is Webority.Chat.Support.Admin. |
|
|
Webority.Chat.Speech
The Azure Speech adapter for Webority Chat: short-lived tokens over managed identity for dictation and read-aloud. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.145.4 | 0 | 11/15/2026 |
| 0.145.3 | 0 | 11/15/2026 |
| 0.145.2 | 0 | 11/15/2026 |
| 0.145.0 | 105 | 11/14/2026 |
| 0.144.0 | 208 | 11/13/2026 |
| 0.143.0 | 165 | 11/13/2026 |
| 0.142.0 | 104 | 11/12/2026 |
| 0.141.0 | 342 | 11/11/2026 |
| 0.140.5 | 311 | 11/10/2026 |
| 0.140.4 | 137 | 11/10/2026 |
| 0.140.3 | 113 | 11/10/2026 |
| 0.140.2 | 122 | 11/10/2026 |
| 0.140.1 | 105 | 11/10/2026 |
| 0.140.0 | 307 | 11/9/2026 |
| 0.139.0 | 115 | 11/9/2026 |
| 0.138.0 | 262 | 11/8/2026 |
| 0.137.11 | 135 | 11/8/2026 |
| 0.137.10 | 133 | 11/7/2026 |
| 0.137.9 | 231 | 11/7/2026 |
| 0.137.8 | 174 | 11/7/2026 |