@avvyr/storefront-sdk - v0.19.0
    Preparing search index...

    Class ReviewsResource

    Index
    • Get review images

      Parameters

      • params: { limit?: number; productId?: string; reviewGroupId?: string } = {}

      Returns Promise<StorefrontAsset[]>

    • Get aggregated review statistics (product + site)

      Returns Promise<ReviewStatistics>

    • Leave a review (with productId) or a review of the store (without).

      Signed in, the customer's access token goes along: the review is linked to the account and uses its email address. When the store requires email confirmation the response has status: "unverified" — show "check your email". The email links to /reviews/verify?token=… on the storefront, which calls verify.

      Parameters

      Returns Promise<SubmitReviewResponse>

    • Confirm a review with the token from the confirmation email.

      Call it when the visitor clicks a button, not on page load: email scanners open links before the customer does. Throws INVALID_TOKEN (404) or TOKEN_EXPIRED (410). Calling it again with a used token returns alreadyVerified: true.

      Parameters

      • token: string

      Returns Promise<VerifyReviewResponse>