Nextra Documentation

website·Indexed 30 days ago

https://hyperse-io.github.io/track

A framework built on top of Next.js for creating content-focused websites. Features include support for MDX, TypeScript, Tailwind CSS, LaTeX (via KaTeX), Mermaid diagrams, and a built-in search engine. Version 4.0 is available.

Tokens
16.2K
Snippets
90
Records
156
Agent score
75%

What's inside Nextra

  1. Overview of Nextra framework

    Nextra is a framework built on top of Next.js designed for creating content-focused websites. It leverages Next.js features while providing specialized tools to easily create content using Markdown.
  2. Overview of the GoogleAdapter plugin for @hyperse/track

    The GoogleAdapter plugin allows developers to integrate Google Analytics and Google Ads event tracking into a @hyperse/track setup. It provides a unified interface to send events to both platforms, includes TypeScript definitions for type safety, and supports tracking page views, form submissions, and user interactions.
  3. Overview of Track data collection library

    Track is a TypeScript-based library designed for efficient and scalable data collection in web applications. It is optimized for the front-end to ensure that data gathering (from DOM elements, user inputs, and network requests) does not negatively impact user experience or application performance. It provides strong typing and type inference to reduce runtime errors and is compatible with popular frameworks such as React, Vue, and Angular.
  4. Overview of Nextra framework features

    Nextra is a flexible site generation framework built with Next.js and MDX. It provides several built-in capabilities for documentation and websites:

    • Optimized Assets: Automatically converts Markdown links and images to next/link and next/image to prevent layout shift and slow navigation.
    • Syntax Highlighting: Uses Shiki for performant, build-time syntax highlighting.
    • Full-Text Search: Zero-config search powered by Pagefind, which indexes content automatically at build-time.
    • Hybrid Rendering: Supports Next.js Server Components, Client Components, and Incremental Static Regeneration (ISR) within Markdown content.
    • Accessibility (A11y): Respects system settings for 'Increase Contrast' and 'Reduce Motion'.
    • MDX 3 Support: Allows the use of React components directly inside Markdown files.
  5. Track Facebook Events donation events

    Use the @hyperse-hub/track-plugin-facebook plugin to track when a person donates funds to an organization or cause. The donation event parameters are optional and can be defined by the user.
    npm install @hyperse-hub/track-plugin-facebook
  6. Create a tracking adapter using AdapterBuilder

    The AdapterBuilder class is a factory used to create a new adapter instance for tracking events. It allows developers to configure the adapter's behavior through a series of hooks that define how events are processed. The process concludes with the .build() method, which returns the configured adapter instance.
    const adapter = adapterBuilder.build();
  7. Define product details using the standard_goods_item type

    The standard_goods_item type from @hyperse-hub/track-plugin-common is used to provide detailed information about a product. To be valid, an item must include at least one of item_id or item_name.
    interface StandardGoodsItem {
      item_id?: string; // Required if item_name is missing
      item_name?: string; // Required if item_id is missing
      affiliation?: string; // Supplying company or store location
      coupon?: string; // Item-level coupon code
      discount?: number; // Unit monetary discount
      index?: number; // Position in a list
      item_brand?: string;
      item_category?: string; // Primary category
      item_category2?: string; // Second category hierarchy
      item_category3?: string; // Third category hierarchy
      item_category4?: string; // Fourth category hierarchy
      item_category5?: string; // Fifth category hierarchy
      item_list_id?: string; // ID of the list containing the item
      item_list_name?: string; // Name of the list containing the item
      item_variant?: string; // Unique code or description for item options
      location_id?: string; // Physical store location (e.g., Google Place ID)
      price?: number; // Unit price (discounted price if applicable)
      quantity?: number;
      image_url?: string;
      url?: string; // Product page URL
      compare_at_price?: number; // Original price for comparison
      row_total?: number; // Total price (price * quantity)
    }
  8. Core architecture of @hyperse/track

    The @hyperse/track library uses a composable architecture to manage analytics integration. Key components include:

    • BaseAdapter: The foundation for creating analytics adapters.
    • AdapterBuilder: Used to construct and configure specific platform adapters.
    • TrackBuilder: The primary API for integrating the tracking engine into modern stacks like React.