Presets

Built-in Presets

PS Guard includes built-in presets with optimized thresholds for common use cases. Use them with the --preset flag or the preset config option.

nextjs

Balanced thresholds for Next.js applications with SSR/SSG. Based on Google's recommended Web Vitals targets.

MetricThreshold
LCP2500ms
CLS0.1
INP200ms
TTFB800ms
FCP1800ms
Min Score90
Devicemobile
bash
npx ps-guard --url https://my-nextjs-app.com --preset nextjs

landing-page

Stricter thresholds for landing pages where first impression and conversion matter. Optimized for fast paint and minimal layout shift.

MetricThreshold
LCP1800ms
CLS0.05
INP100ms
TTFB500ms
FCP1200ms
Min Score95
Devicemobile
bash
npx ps-guard --url https://my-landing.com --preset landing-page

marketing-site

Standard thresholds for marketing sites with images, animations, and dynamic content. More lenient than landing pages.

MetricThreshold
LCP2500ms
CLS0.1
INP200ms
TTFB800ms
FCP1800ms
Min Score85
Devicemobile

Extending Presets

Presets can be combined with custom config. Your config values override the preset:

typescript
// ps-guard.config.ts
export default {
preset: "nextjs",
// Override just the LCP threshold
thresholds: {
lcp: 3000, // More lenient for image-heavy pages
},
// Override device
device: "desktop",
};
Presets provide sensible defaults. Start with a preset and adjust individual thresholds based on your application's needs.