Getting Started
Configuration
All available options for both the frontend provider and the .NET backend.
SEOProvider Props
The <SEOProvider> component wraps your app and accepts these props:
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
apiUrl | string | Yes | /api/seo | Base URL for the SEO API endpoints |
siteId | string | Yes | — | Unique identifier for your site (for multi-site support) |
licenseKey | string | No | "" | Pro/Agency license key. Empty = free tier |
config | Partial<SEOConfig> | No | — | Additional configuration overrides (see below) |
SEOConfig Options
Pass these via the config prop:
<SEOProvider
apiUrl="/api/seo"
siteId="my-site"
config={{
trackAnalytics: true, // Enable/disable page view tracking
respectDNT: true, // Honor Do Not Track browser setting
sessionTimeout: 30, // Session timeout in minutes
excludePaths: ['/admin/*'], // Paths to exclude from tracking
adminApiUrl: '/api/admin/seo' // Admin API URL (auto-derived if not set)
}}
>| Option | Type | Default | Description |
|---|---|---|---|
trackAnalytics | boolean | true | Enable page view + session tracking |
respectDNT | boolean | true | Skip tracking when Do Not Track is enabled |
sessionTimeout | number | 30 | Minutes of inactivity before new session |
excludePaths | string[] | [] | Glob patterns to exclude from tracking |
adminApiUrl | string | Auto | Admin endpoint URL (derived from apiUrl) |
Backend Options (AltiusSEOOptions)
Pass these in the AddAltiusSEO call in your Program.cs:
builder.Services.AddAltiusSEO(options => {
options.ConnectionString = "..."; // Required: SQL Server connection string
options.SiteId = "my-site"; // Site identifier
options.LicenseKey = ""; // Pro/Agency license key
options.HashIps = true; // Hash IP addresses for privacy (default: true)
options.RetentionDays = 365; // Auto-delete analytics data after N days
options.EnableRealTime = false; // Enable real-time visitor tracking (Pro)
});| Option | Type | Default | Description |
|---|---|---|---|
ConnectionString | string | — | Required. SQL Server connection string |
SiteId | string | — | Site identifier. Must match the frontend siteId |
LicenseKey | string | "" | Pro/Agency license key. Empty = free tier |
HashIps | bool | true | Hash visitor IPs before storing (privacy) |
RetentionDays | int | 365 | Auto-purge analytics records older than N days |
EnableRealTime | bool | false | Enable real-time visitor tracking (Pro feature) |
Database Tables
Altius SEO auto-creates 11 tables prefixed with SEO_ when you call app.UseAltiusSEODatabase(). No manual migrations needed.
SEO_PageViews SEO_Sessions SEO_AnalyticsEvents SEO_PageMetas SEO_SitemapEntries SEO_RobotsTxtRules SEO_RobotsTxtConfig SEO_RedirectRules SEO_NotFoundEntries SEO_SchemaTemplates SEO_KeywordAnalyses
License Validation
When a licenseKey is provided:
- 1. On mount, SEOProvider validates the key via
POST /api/seo/license/validate - 2. Valid response is cached in
sessionStoragefor 24 hours - 3. Also cached in
localStoragefor 7-day offline grace period - 4. If validation fails and no cache exists, silently falls back to free plan
The plugin never breaks your site — if the license server is unreachable, free features continue working.