Richie.js API Reference
Richie.js provides flexible APIs for integrating structured data into your project. This reference covers the API for browser-side and Node.js setups, including detailed descriptions of available rich result types.
Browser-Side API
The Richie.js browser-side API allows you to dynamically generate rich results within the browser environment.
RichieJS.default Function
Syntax
RichieJS.default({
  richieNames: [], // Array of rich result types
});Parameters
richieNames(Array):
Specify the rich result types to generate. Each value represents a type of structured data.
Allowed Values:
| Rich Result Type | Description | 
|---|---|
"article" | Structured data for blog posts or articles. | 
"breadcrumb" | Breadcrumb navigation for improving site hierarchy visibility. | 
"crecipe" | Carousel of multiple recipes. | 
"cmovie" | Carousel of movies or video listings. | 
"crestaurant" | Carousel of restaurants or dining options. | 
"ccourse" | Carousel of courses or educational content. | 
"recipe" | A single recipe rich result. | 
"movie" | A single movie rich result. | 
"restaurant" | A single restaurant or dining place rich result. | 
"course" | A single course or educational content rich result. | 
"event" | Details about an event (date, location, etc.). | 
"faq" | Frequently Asked Questions with answers. | 
"video" | Video object with details like duration and upload date. | 
"localbusiness" | Rich result for a business with physical presence (address, hours, etc.).  | 
"organization" | Details about an organization (logo, name, and contact details). | 
"product" | Information about a specific product. | 
"productwv" | A product group or collection of related products. | 
"profile" | Rich result for a personal or organizational profile. | 
"searchbox" | Structured data for a site-wide search box. | 
"software" | Information about software applications or tools. | 
Example Usage
RichieJS.default({
  richieNames: ["crecipe", "faq"],
});This will dynamically generate the JSON-LD snippets for a recipe carousel and a FAQ section.
Node.js API
The Node.js API is designed to generate JSON-LD structured data from pre-rendered HTML files.
richie Function
Syntax
richie(
  richieNames: richies[], // Array of rich result types
  filepath: string,       // Path to the input HTML file
  destinationPath: string = "" // Optional output directory
): Promise<void>;Parameters
- 
richieNames(Array):
Specify the rich result types to generate. Each value represents a type of structured data (refer to the browser-side API table for details). - 
filepath(String):
Path to the input HTML file where the structured data will be added. - 
destinationPath(String) (Optional):
Output path to save the modified HTML file. Defaults to overwriting the original file. 
Example Usage
import { richie } from "@cresteem/richie-js";
 
await richie(
  ["productwv", "breadcrumb"],
  "./input/index.html",
  "./output.html"
);This will process the specified HTML file and inject the JSON-LD snippets for a product group and breadcrumb navigation.
Keywords
- Richie.js
 - Browser-Side API
 - Node.js API
 - SEO Optimization
 - Rich Results
 - Carousel Structured Data
 - Product Group Data