@fayz-ai/plugin-reputation
v0.10.18
Published
[experimental] Fayz SDK — reviews & reputation management plugin
Readme
@fayz-ai/plugin-reputation
Status: experimental (incubating). Now carries most of the capability bar — a mock/Supabase provider pair, an entity registry, migrations with canonical RLS, seed data and tests. Still short of
settings, and the Google/Facebook sync remains unbuilt. Fine to explore in dogfoods; its API may still change without notice.
Reviews and reputation, in one place — see the stars, reply, ask for more.
Reputation is the cheapest growth lever a local business has, and the easiest to ignore. Reviews sit scattered across Google and Facebook, replies never happen, and nobody ever asks the happy customer for a rating. plugin-reputation is the GoHighLevel-style reputation surface for the Fayz engine: a single home for your rating, your review feed, and the actions that move it.
It now does two jobs. The backoffice is a moderation queue: an average-rating card, a star distribution, and a review feed where each row can be published, refused or deleted — reading a real table, not a fixture. The storefront surface (./public) reads the approved rows and renders them: a star rating for a product page, the review list beneath it, and a homepage social-proof section fed by real reviews rather than hardcoded testimonials.
Two shapes of review share one table. A business review has no product and is what the Google/Facebook feed will fill; a product review points at a product and is what a shopper reads on a PDP. Only approved rows ever leave the building — the storefront reads column-whitelisted views, never the base table.
What's inside
- A
/reputationhome: average-rating card, star-distribution bars, and a moderation queue (publish / refuse / delete) - Product reviews: per-product aggregate, per-product feed, and a "verified purchase" badge for reviews tied to an order
- Storefront components —
ProductRating,ProductReviews,TopReviews,Stars— in the lean./publicsubpath - A migration with canonical tenant RLS plus two anon-readable views (
v_public_product_reviews,v_public_product_ratings) - Google / Facebook review sources represented in the UI (sync itself still to come)
- Configurable navigation (label, position, section) and vertical scoping
On a storefront
import { createReputationWebsite, ProductRating, ProductReviews, TopReviews } from '@fayz-ai/plugin-reputation/public'
// Anon storefronts have no session, so the tenant is explicit.
const reviews = createReputationWebsite({ tenantId: storeId })
// Wrap the app in reviews.Provider, then drop components into storefront slots:
<ProductRating productId={product.id} onClick={scrollToReviews} /> // productDetail/afterTitle
<ProductReviews productId={product.id} /> // productDetail/afterDetail
<TopReviews limit={3} productHref={(r) => `/product/${r.productSlug}`} />A catalogue grid should not fire one query per card — ask for every rating at once:
const ratings = await reviews.dataProvider.getProductRatings(products.map((p) => p.id))
<ProductRating average={ratings[p.id].average} count={ratings[p.id].count} />Install
npm install @fayz-ai/plugin-reputationPeer deps: @fayz-ai/core, @fayz-ai/ui, plus react / react-dom.
Usage
import { defineSaas } from '@fayz-ai/admin'
import { createReputationPlugin } from '@fayz-ai/plugin-reputation'
export const app = defineSaas({
// ...
plugins: [
createReputationPlugin({ navLabel: 'Reputation', navPosition: 8 }),
],
})Part of the Fayz SDK
The trust layer of the engine. Pairs with plugin-conversations (turn a great chat into a review request), plugin-crm (know exactly who to ask), and plugin-marketing (feed the social proof back into acquisition).
Roadmap & contributing
Early scaffold — built in the open. See the Fayz SDK roadmap for current gaps, missing features, and good first issues.
