CodeLogic.SocialConnect 4.5.2-preview.68

This is a prerelease version of CodeLogic.SocialConnect.
There is a newer version of this package available.
See the version list below for details.
dotnet add package CodeLogic.SocialConnect --version 4.5.2-preview.68
                    
NuGet\Install-Package CodeLogic.SocialConnect -Version 4.5.2-preview.68
                    
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.5.2-preview.68" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CodeLogic.SocialConnect" Version="4.5.2-preview.68" />
                    
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.5.2-preview.68
                    
#r "nuget: CodeLogic.SocialConnect, 4.5.2-preview.68"
                    
#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.5.2-preview.68
                    
#: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.5.2-preview.68&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=CodeLogic.SocialConnect&version=4.5.2-preview.68&prerelease
                    
Install as a Cake Tool

CodeLogic.SocialConnect

NuGet

Discord webhook and Steam Web API integration for CodeLogic. Send Discord notifications and fetch Steam player profiles, bans, and game libraries.

Install

dotnet add package CodeLogic.SocialConnect

Quick Start

await Libraries.LoadAsync<SocialConnectLibrary>();

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

// Discord — send a webhook text message
await social.Discord.SendMessageAsync("Server restarted");

// Steam — fetch player profile
var player = await social.Steam.GetPlayerAsync("76561198012345678");
if (player.IsSuccess)
    Console.WriteLine($"{player.Value.PersonaName} — {player.Value.ProfileUrl}");

// Steam — check bans
var bans = await social.Steam.GetPlayerBansAsync("76561198012345678");

Services throw InvalidOperationException if accessed while disabled. Guard with the HasDiscord / HasSteam / HasSteamAuth properties when a service may be turned off.

Features

Discord

  • Webhook MessagesSendMessageAsync (text), SendEmbedAsync (rich embeds), or SendAsync (full DiscordWebhookMessage payload)
  • Rich Embeds — title, description, color, fields, author, footer, image, thumbnail, timestamp
  • Mention ControlDiscordAllowedMentions (with .None / .All helpers) to whitelist which roles/users/@everyone may ping
  • TTS — opt-in text-to-speech messages via DiscordWebhookMessage.Tts
  • Default Webhook URL — set once in config, override per call; default username + avatar applied automatically
  • DiscordUser model — username, avatar (with GetAvatarUrl() helper), bot/MFA/verified flags

Steam

  • Player Profiles — persona name, avatar (3 sizes), profile URL, real name, country, online status, plus IsPublic / IsInGame / AccountCreated helpers
  • Player Bans — VAC bans, game bans, economy/trade bans, community bans, plus HasAnyBan helper
  • Game Library — owned games with playtime (TotalPlaytime / RecentPlaytime), LastPlayed, and GetIconUrl(); includeAppInfo toggle on GetOwnedGamesAsync
  • Built-in Cache — configurable TTL (default 5 min) to reduce API calls; clear on demand with Steam.ClearCache()
  • Steam Authentication — ticket-based auth for game server integration (per-call appId override)

Common

  • Result / Result<T> returns — every call returns a typed result; check IsSuccess before reading .Value. Failure codes are categorized by the SocialError enum.
  • Event bus integration — publishes WebhookSentEvent, SteamProfileFetchedEvent, and SteamAuthenticatedEvent for observability
  • Health checkHealthCheckAsync() reports which services are active

Configuration

Auto-generated at data/codelogic/Libraries/CL.SocialConnect/config.socialconnect.json:

{
  "Enabled": true,
  "Discord": {
    "Enabled": true,
    "DefaultWebhookUrl": "https://discord.com/api/webhooks/xxx/yyy",
    "DefaultUsername": "MyApp",
    "DefaultAvatarUrl": "https://example.com/bot.png",
    "TimeoutSeconds": 10
  },
  "Steam": {
    "Enabled": true,
    "ApiKey": "your-steam-web-api-key",
    "AuthEnabled": false,
    "AppId": "480",
    "CacheTtlSeconds": 300,
    "TimeoutSeconds": 15,
    "ApiBaseUrl": "https://api.steampowered.com"
  }
}

Steam.Enabled requires ApiKey. Steam.AuthEnabled additionally requires AppId (your game's Steam App ID). Steam is disabled by default.

Get your Steam Web API key at steamcommunity.com/dev/apikey.

Documentation

Requirements

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 183 6/20/2026
4.6.69-preview 32 6/20/2026
4.5.2 104 5/24/2026
4.5.2-preview.68 59 6/20/2026
4.5.1 162 5/24/2026
4.5.1-preview.56 91 5/24/2026
4.4.2-preview.53 63 5/24/2026
4.4.1 105 5/24/2026
4.0.5 99 5/15/2026
4.0.4 112 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 106 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/).

## [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).