Getting Started
Installation
Get Altius SEO running in your Next.js + .NET application in under 5 minutes.
Prerequisites
- • Node.js 18+
- • .NET 9 SDK
- • SQL Server (LocalDB, Express, or full — see Database Setup)
1
Install packages
Install both the frontend npm package and the backend NuGet package:
# Frontend (Next.js) npm install @altiusseo/next # Backend (.NET) dotnet add package AltiusSEO.Core
2
Configure backend (3 lines)
Add to your Program.cs:
using AltiusSEO.Core.Extensions;
var builder = WebApplication.CreateBuilder(args);
// Add Altius SEO
builder.Services.AddAltiusSEO(options => {
options.ConnectionString = builder.Configuration.GetConnectionString("Default");
options.SiteId = "my-site";
options.LicenseKey = ""; // leave empty for free tier
});
var app = builder.Build();
// Auto-creates 11 database tables on first run
app.UseAltiusSEODatabase();
// Register API endpoints
app.MapAltiusSEO(); // Public: /api/seo/*
app.MapAltiusSEOAdmin(); // Admin: /api/admin/seo/*
app.Run();Add the connection string to appsettings.json:
{
"ConnectionStrings": {
"Default": "Server=(localdb)\\mssqllocaldb;Database=MyApp_SEO;Trusted_Connection=True;TrustServerCertificate=True;"
}
}3
Configure frontend (2 components)
Create a client-side providers wrapper:
// app/providers.tsx
'use client';
import { SEOProvider, SEOTracker } from '@altiusseo/next';
export function Providers({ children }: { children: React.ReactNode }) {
return (
<SEOProvider apiUrl="/api/seo" siteId="my-site">
{children}
<SEOTracker /> {/* Invisible — auto-tracks page views */}
</SEOProvider>
);
}Use it in your root layout:
// app/layout.tsx
import { Providers } from './providers';
export default function RootLayout({ children }) {
return (
<html lang="en">
<body>
<Providers>{children}</Providers>
</body>
</html>
);
}4
Add SEO to pages
Use SEOHead and schema components on individual pages:
// app/blog/[slug]/page.tsx
'use client';
import { SEOHead, ArticleSchema } from '@altiusseo/next';
export default function BlogPost({ post }) {
return (
<>
<SEOHead
title={post.title}
description={post.excerpt}
ogImage={post.coverImage}
canonical={`https://mysite.com/blog/${post.slug}`}
/>
<ArticleSchema
headline={post.title}
author={post.author}
datePublished={post.date}
/>
<article>{post.content}</article>
</>
);
}5
Add the admin dashboard
Drop the dashboard into any admin route:
// app/admin/seo/page.tsx
'use client';
import { SEODashboard } from '@altiusseo/next';
export default function SEOAdmin() {
return <SEODashboard />;
}Visit /admin/seo to see the full 20-tab dashboard with analytics, sitemap, robots.txt, redirects, and more.
6
Add redirect middleware (optional)
Handle 301/302 redirects automatically at the edge:
// middleware.ts
import { NextResponse } from 'next/server';
import type { NextRequest } from 'next/server';
import { createAltiusSEOMiddleware } from '@altiusseo/next/middleware';
const seoMiddleware = createAltiusSEOMiddleware({
apiUrl: process.env.NEXT_PUBLIC_API_URL || '/api/seo',
siteId: 'my-site',
});
export async function middleware(request: NextRequest) {
const seoResponse = await seoMiddleware(request);
if (seoResponse) return seoResponse;
return NextResponse.next();
}Your site now has:
- ✓ Automatic privacy-first page view tracking
- ✓ Meta tags + Open Graph tags on every page
- ✓ Schema markup for rich search results
- ✓ Full admin dashboard at /admin/seo
- ✓ Automatic redirect handling via middleware