Skip to content

API Reference Preview

Power SEO Bot edited this page Feb 27, 2026 · 1 revision

@power-seo/preview API

SERP Preview

import { generateSerpPreview } from '@power-seo/preview';

const serp = generateSerpPreview({
  title: 'My Article Title',
  description: 'A great description of the article',
  url: 'https://example.com/article',
  siteTitle: 'My Blog',
});

console.log(serp.title);             // Full title
console.log(serp.displayUrl);        // Breadcrumb URL
console.log(serp.description);       // Full description
console.log(serp.titleTruncated);    // Title cut off?
console.log(serp.descriptionTruncated); // Description cut off?

Open Graph Preview

import { generateOgPreview } from '@power-seo/preview';

const og = generateOgPreview({
  title: 'Article',
  description: 'Description',
  url: 'https://example.com/article',
  image: { url: 'https://example.com/og.jpg', width: 1200, height: 630 },
});

console.log(og.image?.valid);   // Image dimensions OK?
console.log(og.image?.message); // Any issues?

Test meta tags before publishing.

Clone this wiki locally