Â
Note: This module is universal. Functions in this module can run on both the backend and frontend, unless specified otherwise.
The Comments API allows you to manage a customized commenting program that lets site visitors share feedback or engage in discussions around different types of resources, including blog posts, forum threads, or other site content.
With the Wix Comments API, you can:
To use the Comments API, import { comments } from the wix-comments.v2
module:
The Comments API is fully integrated with several Wix solutions. Each integration uses a slightly different configuration to work with Comments.
The following table details the currently supported integrations:
Wix App | appId | contextId | resourceId |
---|---|---|---|
Wix Blog | 14bcded7-0066-7c35-14d7-466cb3f09103 | internalId | internalId |
Wix Comments | 91c9d6a7-6667-41fb-b0b4-7d3b3ff0b02e | contentId | contentId |
Wix Forum | 14724f35-6794-cd1a-0244-25fd138f9242 | forumPostId | forumPostId |
Wix Groups | 148c2287-c669-d849-d153-463c7486a694 | groupId | feedItemId |
marked
field is set to TRUE
, it indicates that the comment has been flagged or marked for special attention. No additional automated behavior or action is taken with the comment. However, you can manually filter for comments marked as such with the queryComments()
function and highlight them to your visitors as needed.parentComment.id
field of the corresponding reply comment.Functions in Comments API are restricted and only run if you elevate permissions using the wix-auth
elevate()
function.
Warning: Elevating a function allows it to be called by any site visitor. Exercise caution to prevent security vulnerabilities.