Gets a specified post's metrics.
The getPostMetrics()
function returns a Promise that resolves to the specified post's metrics.
A post's metrics include the comments, likes, and views the post receives.
function getPostMetrics(postId: string): Promise<GetPostMetricsResponse>;
Post ID.
import { posts } from "@wix/blog";
async function getPostMetrics(postId) {
const response = await posts.getPostMetrics(postId);
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.