For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
HUMAN DashboardHUMAN WebsiteRequest a Demo
Product GuidesEnforcer GuidesMobile SDKAPI ReferenceCustomer support
Product GuidesEnforcer GuidesMobile SDKAPI ReferenceCustomer support
  • General
    • About Enforcers
    • Support first-party HUMAN calls
    • Troubleshoot Enforcer configurations
  • Enforcer frameworks
    • Akamai ESI
    • Apache - C Module
    • ASP.NET
    • Callout Enforcer
    • Envoy Proxy
    • F5 BIGIP
    • Fastly JavaScript Compute@Edge
    • Google Cloud Platform (GCP) Callout Enforcer
    • Kong Plugin
      • Installation
      • What's New
      • Configuration Options
    • NGINX - C Module
    • NGINX - LUA Module
    • PHP
    • Python
    • Ruby
    • Salesforce Commerce Cloud Cartridge
LogoLogo
Login
Login
HUMAN DashboardHUMAN WebsiteRequest a Demo
On this page
  • Supported versions
  • Installation
  • Install and use a NuGet package in Visual Studio
  • Install and use a package with the dotnet CLI
  • Integration
  • Edit program.cs
  • Configuring Required Parameters
  • Required parameters:
  • Upgrading
Enforcer frameworks.Net Core

Installation

Was this page helpful?
Previous

What's New

Next
Built with

Supported versions


  • .NET >= 6

Installation


To work with NuGet, as a package consumer or creator, you can use command-line interface (CLI) tools as well as NuGet features in Visual Studio.
You can choose one of the following ways:

Install and use a NuGet package in Visual Studio

Install HumanModule using the NuGet Package Manager in Visual Studio:

  1. Select Project > Manage NuGet Packages.
  2. In the NuGet Package Manager page, choose nuget.org as the Package source.
  3. From the Browse tab, search for HumanModule, select HumanModule in the list, and then select Install.

Install and use a package with the dotnet CLI

To install HumanModule, run the following command:

dotnet add package HumanModule

Integration

Edit program.cs

Add Human Module

1using human_module

Using ILoggerFactory (Optional)-

The middleware is designed to work with ILoggerFactory to provide flexibility. If you want to use your own logger using ILoggerFactory, register it in the service container before using the middleware:

1builder.Services.AddSingleton<ILoggerFactory,LoggerFactoryExample>();

Using HttpClientFactory (Optional)-

The middleware is designed to work with IHttpClientFactory to manage HTTP client lifetimes.

If you want HttpClient to be managed using IHttpClientFactory for better resilience and performance, register it in Program.cs as follows:

1builder.Services.AddHttpClient();

Use HumanModule as a Middleware in your application:

1app.UseHumanMiddleware();

Add configuration section (configuration level)

1builder.Services.Configure<EnforcerConfig>(builder.Configuration.GetSection("HumanConfiguration"));

Add site specific configuration (configuration level)
On your app configuration JSON file (Default file name appsettings.json), add the following section:

1...
2"HumanConfiguration": {
3 "px_app_id": "XXX",
4 "px_cookie_secret": "XXX",
5 "px_auth_token": "XXX",
6 Other Human configuration options...
7}

Configuring Required Parameters

Configuration options are set in EnforcerConfig

Required parameters:

  • px_app_id
  • px_cookie_secret
  • px_auth_token

Upgrading

To upgrade to the latest Enforcer version:

  1. In Visual Studio, right click on the solution and Select Manage NuGet packages for solution.
  2. Search for HumanModule in the updates section, and update.