CodeLogic.SocialConnect 4.6.72

This package has a SemVer 2.0.0 package version: 4.6.72+5b7568e.
dotnet add package CodeLogic.SocialConnect --version 4.6.72
                    
NuGet\Install-Package CodeLogic.SocialConnect -Version 4.6.72
                    
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="CodeLogic.SocialConnect" Version="4.6.72" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CodeLogic.SocialConnect" Version="4.6.72" />
                    
Directory.Packages.props
<PackageReference Include="CodeLogic.SocialConnect" />
                    
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 CodeLogic.SocialConnect --version 4.6.72
                    
#r "nuget: CodeLogic.SocialConnect, 4.6.72"
                    
#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 CodeLogic.SocialConnect@4.6.72
                    
#: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=CodeLogic.SocialConnect&version=4.6.72
                    
Install as a Cake Addin
#tool nuget:?package=CodeLogic.SocialConnect&version=4.6.72
                    
Install as a Cake Tool

CodeLogic.SocialConnect

NuGet License: MIT

Discord webhooks and Steam Web API integration for CodeLogic 4 — send rich Discord notifications and read Steam player profiles, bans, and game libraries.

Three services behind one library: a Discord webhook sender (text, rich embeds, full payloads), a Steam profile reader (players, bans, owned games — cached), and Steam authentication for validating game-session tickets. No external NuGet dependencies — built on System.Net.Http.Json.

Install

dotnet add package CodeLogic.SocialConnect

Quick start

using CL.SocialConnect;

await Libraries.LoadAsync<SocialConnectLibrary>();
await CodeLogic.ConfigureAsync();
await CodeLogic.StartAsync();

var social = Libraries.Get<SocialConnectLibrary>();

// Discord — send a webhook text message (Result, no value)
Result sent = await social.Discord.SendMessageAsync("Server restarted");
if (sent.IsFailure)
    Console.WriteLine(sent.Error?.Message);

// Steam — fetch a player profile (Result<SteamPlayer>)
if (social.HasSteam)
{
    Result<SteamPlayer> player = await social.Steam.GetPlayerAsync("76561198012345678");
    if (player.IsSuccess)
        Console.WriteLine($"{player.Value.PersonaName} — {player.Value.ProfileUrl}");
}

Accessing a disabled service throws InvalidOperationException. Guard with HasDiscord / HasSteam / HasSteamAuth when a service may be turned off — Steam is disabled by default.

Features

  • Discord webhooksSendMessageAsync (plain text, max 2000 chars), SendEmbedAsync (up to 10 rich embeds), and SendAsync (full DiscordWebhookMessage); all return Result.
  • Rich embeds — title, description, colour, fields, author, footer, image, thumbnail, and timestamp via DiscordEmbed / DiscordEmbedField.
  • Mention controlDiscordAllowedMentions (with .None / .All) whitelists which roles/users/@everyone may ping; opt-in TTS via DiscordWebhookMessage.Tts.
  • Steam profilesGetPlayerAsync, GetPlayerBansAsync, GetOwnedGamesAsync return Result<T> with computed helpers (IsPublic, IsInGame, HasAnyBan, TotalPlaytime, LastPlayed).
  • Built-in cache — Steam reads are cached for CacheTtlSeconds (default 300); clear on demand with Steam.ClearCache().
  • Steam authenticationAuth.AuthenticateAsync validates a session ticket, with a per-call appId override.
  • EventsWebhookSentEvent, SteamProfileFetchedEvent, and SteamAuthenticatedEvent on the CodeLogic event bus.

Configuration

Auto-generated on first run as config.socialconnect.json:

{
  "Enabled": true,
  "Discord": {
    "Enabled": true,
    "DefaultWebhookUrl": "https://discord.com/api/webhooks/xxx/yyy",
    "TimeoutSeconds": 10,
    "DefaultUsername": "MyApp",
    "DefaultAvatarUrl": "https://example.com/bot.png"
  },
  "Steam": {
    "Enabled": false,
    "ApiKey": "your-steam-web-api-key",
    "AuthEnabled": false,
    "AppId": "",
    "CacheTtlSeconds": 300,
    "TimeoutSeconds": 15,
    "ApiBaseUrl": "https://api.steampowered.com"
  }
}
Setting Default Description
Enabled true Master switch for the whole library.
Discord.Enabled true Enable the Discord webhook service.
Discord.DefaultWebhookUrl "" Webhook used when a call omits webhookUrl (secret).
Discord.TimeoutSeconds 10 HTTP timeout for Discord calls (1–120).
Discord.DefaultUsername "" Default sender name applied to messages.
Discord.DefaultAvatarUrl "" Default sender avatar applied to messages.
Steam.Enabled false Enable the Steam profile service; requires ApiKey.
Steam.ApiKey "" Steam Web API key (secret) — get one at steamcommunity.com/dev/apikey.
Steam.AuthEnabled false Enable ticket authentication; requires AppId.
Steam.AppId "" Your game's Steam App ID (used by auth).
Steam.CacheTtlSeconds 300 Profile cache lifetime in seconds (must be > 0).
Steam.TimeoutSeconds 15 HTTP timeout for Steam calls (1–120).
Steam.ApiBaseUrl https://api.steampowered.com Steam Web API base URL.

Documentation

Full guide: CL.SocialConnect documentation

Requirements

  • CodeLogic 4 · .NET 10
  • No external NuGet dependencies

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
4.6.72 177 6/20/2026
4.6.69-preview 30 6/20/2026
4.5.2 103 5/24/2026
4.5.2-preview.68 56 6/20/2026
4.5.1 161 5/24/2026
4.5.1-preview.56 91 5/24/2026
4.4.2-preview.53 63 5/24/2026
4.4.1 104 5/24/2026
4.0.5 99 5/15/2026
4.0.4 111 5/9/2026
4.0.3 105 5/9/2026
3.3.1 621 4/18/2026
3.3.0 114 4/18/2026
3.2.11 123 4/18/2026
3.2.10 107 4/18/2026
3.2.9 111 4/18/2026
3.2.8 104 4/18/2026
3.2.7 101 4/18/2026
3.2.6 105 4/18/2026
3.2.5 114 4/18/2026
Loading failed

# CL.SocialConnect — Changelog

All notable changes to **CodeLogic.SocialConnect** are documented here. Versions follow
[Semantic Versioning](https://semver.org/).

## 2026-06-20

### Fixed

- Discord sends now validate the 2000-character content limit and 10-embed limit
 up front, returning a clear validation error instead of a failed HTTP
 round-trip.
- Corrected the `CommunityVisibilityState` documentation comment (the Steam Web
 API returns 1 = not visible / 3 = public to third parties; the previous
 comment listed nonexistent levels).

### Documentation

- Full rewrite of the README and the `docs/libs/socialconnect.md` guide to the
 current house style.
- README restructured to the standard layout (badges, tagline, intro, Install,
 Quick start, Features, Configuration with table + JSON, Documentation,
 Requirements, License) and now links the published docs page.
- Corrected the `Result` contract throughout: Discord methods return `Result`
 (no value); Steam profile and auth methods return `Result<T>`. Examples use
 `IsSuccess` / `IsFailure`, `.Value`, and `Error?.Message`.
- Documented the canonical load sequence (`LoadAsync` → `ConfigureAsync` →
 `StartAsync` → `Libraries.Get`) and the `HasDiscord` / `HasSteam` /
 `HasSteamAuth` guards (Steam disabled by default).
- Added a deep guide covering the three services, Discord webhook methods and
 full model reference (with a rich-embed example), the Steam profile/bans/games
 models and computed properties, Steam ticket authentication, caching
 (`CacheTtlSeconds`, `ClearCache`), configuration, events, and the health check.

## [4.5.2] — 2026-06-20

### Documentation

- Corrected the README Quick Start: the text-message helper is
 `Discord.SendMessageAsync(...)`, not `SendAsync(string, username:)`.
- Fixed the README configuration example to use PascalCase JSON keys and added the
 previously omitted `DefaultAvatarUrl`, `AuthEnabled`, `AppId`, and `ApiBaseUrl` fields.
- Documented previously undocumented user-facing API surface:
 - Discord `SendAsync(DiscordWebhookMessage)`, `DiscordAllowedMentions`
   (`.None` / `.All`), and the `Tts` flag.
 - Steam `SteamProfileService.ClearCache()` and the `GetOwnedGamesAsync`
   `includeAppInfo` parameter.
 - Per-call `appId` override on `Auth.AuthenticateAsync`.
 - `SteamPlayer` (`IsPublic`, `IsInGame`, `AccountCreated`), `SteamPlayerBans`
   (`HasAnyBan`), and `SteamGame` (`TotalPlaytime`, `RecentPlaytime`, `LastPlayed`,
   `GetIconUrl`) computed helpers; the `DiscordUser` model.
 - `HasDiscord` / `HasSteam` / `HasSteamAuth` availability properties and the
   `InvalidOperationException` thrown when a disabled service is accessed.
 - Event-bus events `WebhookSentEvent`, `SteamProfileFetchedEvent`, and
   `SteamAuthenticatedEvent`, and the `SocialError` failure-code enum.

## [4.5.0] — 2026-05-24

### Changed

- **Unified versioning.** All CodeLogic.Libs now share a single version line
 controlled by `version.txt` in the repo root. This is a version alignment
 release — no functional changes to this library.
## [4.0.4] — 2026-04-16

### Changed

- README + manifest refresh for the v4 baseline. No functional changes vs 4.0.3.
- `LibraryManifest.Version` now reads from assembly metadata.

## [4.0.2] — 2026-04-09

### Changed

- Annotated SocialConnect configuration with `[ConfigField]` for the admin UI surface.
- Aligned with the v4 baseline across all libraries.

### Fixed

- Closed resource leaks in the OAuth client + reworked the health check so
 it no longer mutates internal state as a side-effect.

## [4.0.0] — 2026-04-09

Major rewrite. Republished as v4.0.0 to reset the version line under the
unified v4 baseline. OAuth/OIDC providers (Google, Discord, Steam,
generic OIDC) with a uniform abstraction.

### Notes

- Earlier history is retained in the
 [git log](https://github.com/Media2A/CodeLogic.Libs/commits/main/CL.SocialConnect).