tcerqueira / gotcha-widget-lib

0 stars 0 forks source link

Documentation and Implementation Are Not in Sync #1

Open sanjaysah101 opened 3 hours ago

sanjaysah101 commented 3 hours ago

Description

While exploring the documentation and integrating it into my project for CAPTCHA Game Challenge, I noticed a mismatch between the provided documentation and the type definitions in this repository.

Observations

The implementation in the repository suggests the following structure:

/**
 * Handles the challenge response and communicates with the parent window
 * @param success - Whether the challenge was successful
 * @param win - Target window (defaults to window.parent)
 */
export async function onChallengeResponse(
  success: boolean,
  win: Window = window.parent,
) {
  const message: WidgetMessage = {
    type: "response-callback",
    success,
  };
  win.postMessage(message, TARGET_ORIGIN);
}

Here’s a screenshot of the relevant section in the documentation:

Screenshot of Documentation

Steps to Reproduce

  1. Refer to the documentation here.
  2. Compare the example code with the actual implementation in the repository.
tcerqueira commented 2 hours ago

The documentation of the challenge is outdated, follow this repo's documentation. Thanks for pointing that out