Skip to content

Authentication

The Poli Page .NET SDK authenticates every request with a bearer token. The key prefix determines which environment the request hits.

Pass the key to the client through PoliPageClientOptions:

var client = new PoliPageClient(new PoliPageClientOptions
{
ApiKey = Environment.GetEnvironmentVariable("POLI_PAGE_API_KEY")!,
});

The SDK never reads POLI_PAGE_API_KEY implicitly — you always pass the key in through ApiKey. Passing a null, empty, or whitespace value throws ArgumentException from the PoliPageClient constructor.

using PoliPage;
var client = new PoliPageClient(new PoliPageClientOptions
{
ApiKey = Environment.GetEnvironmentVariable("POLI_PAGE_API_KEY")!,
});