Skip to content
GEO AI
AnalyzerCLIDocumentationSpecificationContact
Documentation

Getting Started

  • Introduction
  • Quick Start
  • Choose Your Package

GEO Specification

  • Overview
  • llms.txt
  • AI Metadata
  • Crawler Rules
  • Structured Signals
  • Scoring
  • Recommendations

Packages

  • GEO AI Core
  • GEO AI Next
  • GEO AI NestJSnew
  • NestJS — Module Setup
  • NestJS — Configuration
  • NestJS — Service API
  • NestJS — Middleware
  • NestJS — Guard
  • NestJS — Interceptor
  • NestJS — Decorators
  • NestJS — Content Provider
  • GEO AI Woo
  • GEO AI Shopify

Analyzer

  • Overview
  • Scoring
  • Recommendations

CLI

  • GEO AI CLI

Integrations

  • Laravelsoon

Reference

  • Configuration
  • API Reference
  • FAQ
DocsPackagesNestjsModule

Module Setup

GeoAIModule is a dynamic NestJS module. Use forRoot for synchronous config and forRootAsync when config depends on environment variables or other services.

forRoot (synchronous)

typescript
import { Module } from '@nestjs/common';
import { GeoAIModule } from 'geo-ai-nest';

@Module({
  imports: [
    GeoAIModule.forRoot({
      siteName: 'My Store',
      siteUrl: 'https://mystore.com',
      provider: {
        Products: [
          { title: 'Widget', url: '/products/widget', description: 'A great widget' },
        ],
        Blog: [
          { title: 'Hello World', url: '/blog/hello', description: 'First post' },
        ],
      },
      crawlers: 'all',
      cache: '24h',
      crawlTracking: true,
    }),
  ],
})
export class AppModule {}

forRootAsync (async)

Use forRootAsync when your config depends on environment variables or other services:

typescript
import { Module } from '@nestjs/common';
import { ConfigModule, ConfigService } from '@nestjs/config';
import { GeoAIModule } from 'geo-ai-nest';

@Module({
  imports: [
    ConfigModule.forRoot(),
    GeoAIModule.forRootAsync({
      imports: [ConfigModule],
      useFactory: (config: ConfigService) => ({
        siteName: config.get('SITE_NAME'),
        siteUrl: config.get('SITE_URL'),
        provider: new MyContentProvider(),
        crawlers: 'all',
        cache: config.get('GEO_CACHE_TTL', '24h'),
        crawlTracking: true,
      }),
      inject: [ConfigService],
    }),
  ],
})
export class AppModule {}
forRootAsync also supports useClass and useExisting via the GeoAIOptionsFactory interface.
PreviousGEO AI NestJSNextNestJS — Configuration

On this page

  • forRoot (synchronous)
  • forRootAsync (async)
GEO AI

AI Search Optimization

AnalyzerCLIDocumentationSpecificationContactPrivacy Policy

© 2026 GEO AI · Open Source · MIT License