Skip to main content
The FAQ (@spurtcommerce/faq) adds FAQ management functionality to a SpurtCommerce application. It provides APIs for vendors to manage FAQ categories and their questions, and APIs for the storefront to retrieve active FAQs. The package is designed as a plug-and-play add-on for SpurtCommerce Community and Enterprise editions. Once installed, the host application’s add-on loader discovers and registers its components.

Key Features

  • Vendor FAQ management: Create, list, view, update, and delete FAQ categories and their associated questions.
  • Storefront FAQ access: Retrieve active FAQs based on the customer user type.
  • Structured FAQ data: Store the main FAQ record separately from its child questions and answers.
  • Automatic registration: The host application’s addonPackageLoader registers the package’s entities, controllers, and migrations.
  • Safe package removal: The host application is designed to continue running when the FAQ package is uninstalled.

Requirements

  • A compatible SpurtCommerce Community or Enterprise project.
  • The project must include the add-on loading mechanism (addonPackageLoader) expected by the package.

Installation

Run the following command from the root directory of your SpurtCommerce project:
For local development or testing from a source checkout, install the package using its local path:
After installation, the host application’s add-on loader discovers the package and registers its components. No separate manual registration of the FAQ entities, controllers, or migrations is described by the package’s plug-and-play integration.

How the Add-on Works

The FAQ add-on is composed of API controllers and TypeORM data models. When the host application loads the installed package, addonPackageLoader handles the registration of: This allows the FAQ functionality to be integrated through package installation rather than requiring developers to manually wire each component into the host application.

API Overview

The add-on exposes two API groups.

Vendor FAQ API

Base route: /api/faq/* The vendor API is used to manage FAQ categories and their child questions. The supported operations include:
  • Creating FAQ records
  • Listing FAQ records
  • Retrieving FAQ details
  • Updating FAQ records
  • Deleting FAQ records
A FAQ consists of a main record and its associated questions and answers. The exact endpoint paths, request fields, and response structures should be taken from the API controllers and DTOs in the installed package.

Store FAQ API

Base route: /api/store-faq/* The storefront API provides access to active FAQs. FAQ results are filtered according to the customer user type. This API is intended for storefront experiences that need to display relevant FAQ content to customers.

Data Models

The add-on uses two TypeORM entities: FaqDescription is linked to the main Faq record. Together, these entities represent the FAQ content managed through the vendor API and retrieved through the storefront API.

Application Integration

After installing the package:
  1. Keep the package installed in the SpurtCommerce project.
  2. Start the application using the project’s normal development or production procedure.
  3. Allow the host application’s addonPackageLoader to discover and register the add-on components.
  4. Use the vendor FAQ API to manage FAQ content.
  5. Use the storefront FAQ API to retrieve active FAQs for customers.
The add-on’s entities, controllers, and migrations are registered through the host application’s loader. Refer to the package source for any version-specific integration requirements.

Uninstallation

To remove the FAQ add-on, run the following command from the SpurtCommerce project root:
The package is designed so that the host application can continue running when the FAQ add-on is absent. The FAQ routes and functionality will no longer be provided by the uninstalled package.
Note: Uninstalling the package removes the add-on from the application. This documentation does not imply that its database tables or existing records are automatically deleted.

Summary

@spurtcommerce/faq provides vendor-managed FAQ content and storefront FAQ retrieval as an installable SpurtCommerce add-on. Its integration with addonPackageLoader is intended to handle the registration of its controllers, entities, and migrations, reducing the manual integration work required from developers.