Review Infra Docs
Headless reviews, nudges, moderation, and widgets for developers.
1. Install SDK
pnpm add @review-infra/sdk
2. Load reviews
import { ReviewInfraClient } from '@review-infra/sdk';

const client = new ReviewInfraClient({
  apiBaseUrl: 'https://your-api-domain.com',
  apiKey: 'YOUR_API_KEY',
});

const data = await client.getReviews({
  productId: 'prod_1',
  page: 1,
  limit: 5,
  sort: 'newest',
});
3. Submit reviews
const result = await client.submitReview({
  apiKey: 'YOUR_API_KEY',
  productId: 'prod_1',
  rating: 5,
  title: 'Amazing',
  text: 'Loved it',
  authorName: 'Shubham',
  authorEmail: 'dev@example.com',
});
4. Auth + stores
const auth = new ReviewInfraClient({ apiBaseUrl: 'https://your-api-domain.com' });

const { token } = await auth.login('dev@example.com', 'password123');

auth.setBearerToken(token);

const store = await auth.createStore('My Store');
const stores = await auth.listStores();
5. Create and send nudges
const app = new ReviewInfraClient({
  apiBaseUrl: 'https://your-api-domain.com',
  bearerToken: 'YOUR_BEARER_TOKEN',
});

const nudge = await app.createNudge({
  storeId: 'store_id',
  productId: 'product_id',
  customerName: 'Customer',
  customerEmail: 'customer@example.com',
  orderRef: 'order_1',
});

const nudges = await app.listNudges('store_id');
await app.sendNudge(nudge.id);
6. Script widget
<script src="https://your-api-domain.com/embed/widget.js"></script>

<div
  data-review-product="prod_1"
  data-review-api="https://your-api-domain.com"
  data-api-key="YOUR_API_KEY"
  data-review-sort="newest"
  data-review-limit="5">
</div>
7. Core endpoints
POST   /auth/register
POST   /auth/login
GET    /auth/me
GET    /stores
POST   /stores
GET    /reviews/:productId
GET    /reviews/admin/list/:productId
POST   /public-reviews/submit
GET    /review-nudges
POST   /review-nudges
POST   /review-nudges/send
POST   /auto-nudges/ingest-order
POST   /cron/run-auto-nudges