> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Method name: createComment(comment: Comment, options: CreateCommentOptions) # Method package: wixCommentsV2 # Method menu location: wixCommentsV2 --> comments --> createComment # Method Link: https://dev.wix.com/docs/velo/apis/wix-comments-v2/comments/create-comment.md # Method Description: Creates a new comment and publishes it. The `appId`, `contextId`, and `resourceId` are all required and associate the created comment with the specific resource it responds to. See **Integrations** in the Comments introduction for a list of integrated scopes for these fields. If the created comment is a direct response to another comment, the `commentId` of the parent comment should be passed as `parentComment.id` in this comment's request. See **Terminology** in the Comments introduction for additional information on parent comments and replies. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## createComment example for dashboard page code ```javascript import { comments } from 'wix-comments.v2'; async function createComment(comment, options) { try { const result = await comments.createComment(comment, options); return result; } catch (error) { console.error(error); // Handle the error } } ``` ## createComment example for exporting from backend code ```javascript import { comments } from 'wix-comments.v2'; import { webMethod, Permissions } from 'wix-web-module'; import { elevate } from 'wix-auth'; const elevatedCreateComment = elevate(comments.createComment); export const createComment = webMethod( Permissions.Anyone, async (comment, options) => { try { const result = await elevatedCreateComment(comment, options); return result; } catch (error) { console.error(error); // Handle the error } } ); ``` ---