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:

PropTypeRequiredDefaultDescription
apiUrlstringYes/api/seoBase URL for the SEO API endpoints
siteIdstringYesUnique identifier for your site (for multi-site support)
licenseKeystringNo""Pro/Agency license key. Empty = free tier
configPartial<SEOConfig>NoAdditional 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)
  }}
>
OptionTypeDefaultDescription
trackAnalyticsbooleantrueEnable page view + session tracking
respectDNTbooleantrueSkip tracking when Do Not Track is enabled
sessionTimeoutnumber30Minutes of inactivity before new session
excludePathsstring[][]Glob patterns to exclude from tracking
adminApiUrlstringAutoAdmin 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)
});
OptionTypeDefaultDescription
ConnectionStringstringRequired. SQL Server connection string
SiteIdstringSite identifier. Must match the frontend siteId
LicenseKeystring""Pro/Agency license key. Empty = free tier
HashIpsbooltrueHash visitor IPs before storing (privacy)
RetentionDaysint365Auto-purge analytics records older than N days
EnableRealTimeboolfalseEnable 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. 1. On mount, SEOProvider validates the key via POST /api/seo/license/validate
  2. 2. Valid response is cached in sessionStorage for 24 hours
  3. 3. Also cached in localStorage for 7-day offline grace period
  4. 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.