ForEach.Infrastructure.External.Meta 0.1.0

dotnet add package ForEach.Infrastructure.External.Meta --version 0.1.0
                    
NuGet\Install-Package ForEach.Infrastructure.External.Meta -Version 0.1.0
                    
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="ForEach.Infrastructure.External.Meta" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ForEach.Infrastructure.External.Meta" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="ForEach.Infrastructure.External.Meta" />
                    
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 ForEach.Infrastructure.External.Meta --version 0.1.0
                    
#r "nuget: ForEach.Infrastructure.External.Meta, 0.1.0"
                    
#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 ForEach.Infrastructure.External.Meta@0.1.0
                    
#: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=ForEach.Infrastructure.External.Meta&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=ForEach.Infrastructure.External.Meta&version=0.1.0
                    
Install as a Cake Tool

ForEach.Infrastructure.External.Meta

Everything that talks to Meta — Messenger, Instagram, the WhatsApp Cloud API, Lead Ads and the webhooks all of them arrive on — in one library with no dependencies, so more than one product can use it.

What it does not do

Three things, deliberately, because each of them is the host's:

  • It persists nothing. No conversation, no message, no inbound event. The library parses and calls; where any of it is stored is a decision about somebody's database.
  • It retries nothing. A failure comes back with IsWorthRetrying and the host's job scheduler decides. A library that retried on its own would do it inside a request somebody is waiting on.
  • It decides no policy. Consent, opt-out words, who may reply to whom, which template belongs to which feature — all of that is a business rule, and business rules differ per product.

Credentials

Three classes, because they have three different owners and lifetimes:

Class Holds Whose it is
MetaAppCredentials app id, app secret, webhook verify token, Graph version ours
MetaPageCredentials page id, page token, Instagram account id the customer's, revocable by them
WhatsAppCredentials phone number id, WABA id, token the customer's

Each has IsConfigured — whether a call is worth making at all — so a host can run dark until somebody connects an account rather than failing a job every day.

Results and errors

var result = await client.SendTextAsync(recipientId, "Dobar dan");

if (result.IsSuccess) return result.Value;          // the message id
if (result.IsWorthRetrying) return Retry(result);   // transport, or Meta-side
Notify(result.FailureMessage);                       // Meta's own words, for a person to read

MetaResult<T> keeps two kinds of failure apart: a MetaError Meta itself reported, and a transport problem that never reached it. A caller deciding whether to retry needs to know that a timeout is not an expired token.

MetaError.Kind sorts Meta's codes into the four responses a host actually has:

Kind Examples What to do
Configuration 190, 102, 104 token invalid or expired — tell somebody, stop retrying
PolicyRefused 10/2018278, 551, 131047 outside the 24-hour window, recipient unreachable — show it, never retry
CallerMistake 132000–132016, 100 wrong parameters or missing permission — fix the call
Transient 4, 17, 32, 613, 130429, and anything unknown retry later

Unknown codes are transient on purpose: a wasted retry costs one scheduled run, and giving up on something that would have worked costs the message until somebody notices.

Testing

ForEach.Infrastructure.External.Meta.UnitTests covers the parsers and the error table against recorded payloads; the clients are exercised through a recording HttpMessageHandler. …IntegrationTests makes live calls and skips itself unless the META_* and WHATSAPP_* environment variables are set, so it never runs in CI by accident.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.

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
0.1.0 94 11/3/2026