Preparing search index...

    Interface for recipe source providers

    Defines the contract that all recipe providers must implement to support bulk recipe import from external websites.

    interface RecipeProvider {
        id: string;
        name: string;
        logoUrl: string;
        supportedLanguages?: readonly string[];
        getBaseUrl(): Promise<string>;
        discoverRecipeUrls(
            options: DiscoveryOptions,
        ): AsyncGenerator<DiscoveryProgress>;
        extractImageFromHtml(html: string): string | null;
        canHandleUrl(url: string): boolean;
    }

    Implemented by

    Index
    id: string

    Unique identifier for this provider (e.g., 'hellofresh')

    name: string

    Human-readable display name shown in the UI

    logoUrl: string

    URL to the provider's logo image

    supportedLanguages?: readonly string[]

    Languages this provider supports. If undefined, available for all languages.

    • Returns the base URL for this provider, resolved from the user's locale

      Returns Promise<string>

      Promise resolving to the provider's base URL

    • Extracts a recipe image URL directly from page HTML, when the provider has a faster or more reliable path than the recipe scraper

      The orchestrating hook (useRecipeScraper) calls this first when fetching a recipe image and falls back to the scraper-derived image when the provider returns null. Default implementations may return null.

      Parameters

      • html: string

        Raw HTML content of the recipe page

      Returns string | null

      Image URL extracted from the HTML, or null when not available

    • Returns true if this provider can handle the given recipe source URL

      Used to find the correct provider for a recipe URL without calling any async methods. Implementations should check URL prefixes against their known base URL(s).

      Parameters

      • url: string

        Recipe source URL to test

      Returns boolean

      true if this provider owns the URL