{"id":16432557,"url":"https://github.com/0x6a69616e/kpsdk-solver","last_synced_at":"2025-03-16T17:35:40.978Z","repository":{"id":216416971,"uuid":"740581180","full_name":"0x6a69616e/kpsdk-solver","owner":"0x6a69616e","description":"A Playwright-based solver for Kasada's bot defense platform.","archived":false,"fork":false,"pushed_at":"2024-04-08T13:35:30.000Z","size":218,"stargazers_count":61,"open_issues_count":5,"forks_count":12,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-03-16T04:22:56.166Z","etag":null,"topics":["captcha","captcha-solver","kasada","kasada-reverse","kasada-solver","kick","kpsdk","kpsdk-cd","kpsdk-ct","kpsdk-solver","kspdk","nike","playstation","psn","twitch","x-kpsdk-cd","x-kpsdk-ct"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/kpsdk-solver","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0x6a69616e.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-08T16:28:35.000Z","updated_at":"2025-03-09T18:07:10.000Z","dependencies_parsed_at":"2024-10-27T11:05:37.295Z","dependency_job_id":"157dab72-d81b-4048-911a-0e1df63f4c0d","html_url":"https://github.com/0x6a69616e/kpsdk-solver","commit_stats":null,"previous_names":["0x6a69616e/kpsdk-solver"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0x6a69616e%2Fkpsdk-solver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0x6a69616e%2Fkpsdk-solver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0x6a69616e%2Fkpsdk-solver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0x6a69616e%2Fkpsdk-solver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0x6a69616e","download_url":"https://codeload.github.com/0x6a69616e/kpsdk-solver/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243908924,"owners_count":20367497,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["captcha","captcha-solver","kasada","kasada-reverse","kasada-solver","kick","kpsdk","kpsdk-cd","kpsdk-ct","kpsdk-solver","kspdk","nike","playstation","psn","twitch","x-kpsdk-cd","x-kpsdk-ct"],"created_at":"2024-10-11T08:43:46.045Z","updated_at":"2025-03-16T17:35:40.689Z","avatar_url":"https://github.com/0x6a69616e.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kpsdk-solver\n\u003e A Playwright-based solver for Kasada's bot defense platform.\n\nAvailable as a replacement to [`Browser.newPage()`](https://playwright.dev/docs/api/class-browser#browser-new-page) and [`BrowserContext.newPage()`](https://playwright.dev/docs/api/class-browsercontext#browser-context-new-page)\n\n## Features\n- Extensive manipulation of the Kasada SDK\n  - Use custom script import\n  - Use custom configuration\n  - Inspect SDK messages\n  - Interact with Kasada's Fetch API\n  - Use same-page client token regeneration\n- Support for CommonJS (CJS) and ECMAScript module (ESM) use\n- Seamless integration with the Playwright library\n\n## Limitations\n- Only compatible with Playwright\n- Fails to bypass detection on... (based on common issues - results may vary)\n  - Chrom(e/ium) browsers; Firefox preferred [[article]](https://substack.thewebscraping.club/i/108229509/playwright-with-firefox) [[article]](https://substack.thewebscraping.club/i/99643353/the-tests-results) [[image]](https://substack-post-media.s3.amazonaws.com/public/images/f178b49a-6646-43f6-abe4-b09e3341f844_1178x225.png)\n  - Most Linux machines; Windows preferred\n\n## Installation\n```sh\n$ npm install kpsdk-solver\n```\n\n## Usage\n```js\nimport playwright from 'playwright';\nimport Solver from 'kpsdk-solver';\n\nconst solver = new Solver(config);\n\n(async () =\u003e {\n  const browser = await playwright.firefox.launch({ headless: true });\n  const context = await browser.newContext();\n\n  const page = await solver.create(context, page =\u003e {\n    // optional, page callback; access the page instance before the solver uses it\n    console.log(page.url()); // should return about:blank or smthn\n  });\n\n  // retrieve the SDK messages\n  console.log(page.solver.messages); // KPSDK:DONE:...\n\n  // make a modifiable fetch request\n  const { route, request } = await page.solver.fetch('/api/kasada-protected-endpoint');\n\n  /// refer to playwright.dev/docs/api/class-request\n  console.log(request.headers()); // capture the headers of that request, including x-kpsdk-*\n  /// refer to playwright.dev/docs/api/class-route\n  await route.abort(); // abort unless same-page client token regeneration should be used\n\n  await page.close();\n  await context.close();\n  await browser.close();\n})();\n```\n\n## Configuration\n```js\n{\n  // `kasada` specifies Kasada-protected endpoints in a parsed format\n  kasada: [{\n    domain: 'some-domain.com',\n    method: 'POST',\n    path: '/api/kasada-protected-endpoint',\n    protocol: 'https:'\n  }],\n\n  // `load-complete` indicates whether or not to completely load the target page\n  // Kasada-protected endpoint configurations do not need to be specified when this option is enabled\n  // when disabled, the target page loads with no content\n  'load-complete': false, // default\n\n  // `request-tracing` indicates whether or not to trace Fetch requests initiated by `page.solver.fetch()`\n  // when enabled, such requests are assigned a unique identifier that can be accessed through the `X-Trace-Id` header\n  // this option should be enabled in scenarios where numerous requests for the same URL might happen simultaneously within the same page instance when calling `page.solver.fetch()`\n  'request-tracing': false, // default\n\n  // `sdk-script` specifies the Kasada SDK script to import\n  // see available options at playwright.dev/docs/api/class-page#page-add-init-script-option-script\n  'sdk-script': {\n    url: 'https://some-domain.com/149e9513-01fa-4fb0-aad4-566afd725d1b/2d206a39-8ed7-437e-a3be-862e0f06eea3/p.js'\n  },\n\n  // `url` specifies the target page URL which the browser will navigate to\n  // this affects the Referer and Origin headers of requests, as well as other origin-dependant properties\n  // HTTP redirects are still considered when `load-complete` is disabled\n  url: 'https://some-domain.com'\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0x6a69616e%2Fkpsdk-solver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0x6a69616e%2Fkpsdk-solver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0x6a69616e%2Fkpsdk-solver/lists"}