{"id":23683912,"url":"https://github.com/copyleaks/nodejs-plagiarism-checker","last_synced_at":"2025-10-18T18:01:32.997Z","repository":{"id":38421297,"uuid":"60248530","full_name":"Copyleaks/NodeJS-Plagiarism-Checker","owner":"Copyleaks","description":"Copyleaks Plagiarism Checker - NodeJS SDK.","archived":false,"fork":false,"pushed_at":"2024-09-18T14:21:31.000Z","size":3113,"stargazers_count":19,"open_issues_count":3,"forks_count":11,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-11-23T03:40:02.719Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://api.copyleaks.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Copyleaks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2016-06-02T08:58:07.000Z","updated_at":"2024-09-11T11:50:02.000Z","dependencies_parsed_at":"2024-09-11T15:46:37.022Z","dependency_job_id":"9703bc93-ad5f-47d3-9399-622e2f3f3c2f","html_url":"https://github.com/Copyleaks/NodeJS-Plagiarism-Checker","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Copyleaks%2FNodeJS-Plagiarism-Checker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Copyleaks%2FNodeJS-Plagiarism-Checker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Copyleaks%2FNodeJS-Plagiarism-Checker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Copyleaks%2FNodeJS-Plagiarism-Checker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Copyleaks","download_url":"https://codeload.github.com/Copyleaks/NodeJS-Plagiarism-Checker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231785050,"owners_count":18426283,"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":[],"created_at":"2024-12-29T20:29:55.832Z","updated_at":"2025-10-18T18:01:32.987Z","avatar_url":"https://github.com/Copyleaks.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Copyleaks SDK\nThe official [Copyleaks](https://copyleaks.com/) JavaScript library.\n\n## 🚀 Getting Started\nBefore you start, ensure you have the following:\n\n*   An active Copyleaks account. If you don’t have one, [sign up for free](https://copyleaks.com/signup).\n*   You can find your API key on the [API Dashboard](https://api.copyleaks.com/dashboard).\n\nOnce you have your account and API key:\n\n**Install the SDK**:\n\nInstall using [npm](https://www.npmjs.com/package/plagiarism-checker)  \n```bash\nnpm i plagiarism-checker\n```\n\n\n## 📚 Documentation\nTo learn more about how to use Copyleaks API please check out our [Documentation](https://docs.copyleaks.com/resources/sdks/javascript/). \n\n## 💡 Usage Examples\nHere are some common usage examples for the Copyleaks SDK. You can also see a comprehensive code example in the `index.js` file on our GitHub repository: [index.js](https://github.com/Copyleaks/NodeJS-Plagiarism-Checker/blob/master/demo/index.js).\n\n### Get Authentication Token\nThis example demonstrates how to log in to the Copyleaks API and obtain an authentication token.\n\n```javascript\nconst { Copyleaks } = require('plagiarism-checker');\n\n// --- Your Credentials ---\nconst EMAIL_ADDRESS = 'YOUR_EMAIL_ADDRESS';\nconst KEY = 'YOUR_API_KEY';\n// --------------------\n\nasync function main() {\n  console.log('Authenticating...');\n  const copyleaks = new Copyleaks();\n  const authToken = await copyleaks.loginAsync(EMAIL_ADDRESS, KEY);\n  console.log('✅ Login successful!');\n}\n\nmain();\n```\nFor a detailed understanding of the authentication process, refer to the Copyleaks Login Endpoint [Documentation](https://docs.copyleaks.com/reference/actions/account/login).\n##\n### Submit Text for Plagiarism Scan\nThis example shows how to prepare and submit raw text content for a plagiarism scan.\n\n```javascript\nconst { Copyleaks,CopyleaksFileSubmissionModel } = require('plagiarism-checker');\n\n// --- Your Credentials ---\nconst EMAIL_ADDRESS = 'YOUR_EMAIL_ADDRESS';\nconst KEY = 'YOUR_API_KEY';\nconst WEBHOOK_URL = 'https://your-server.com';\n// --------------------\n\nasync function main() {\n  var submission = new CopyleaksFileSubmissionModel(\n    \"SGVsbG8gV29ybGQ=\",\n    \"nodejs-sdk-demo.txt\",\n    {\n      sandbox: true,\n      webhooks: {\n        status: `${WEBHOOK_URL}/webhook/{STATUS}`,\n      },\n    }\n  );\n\n  copyleaks.submitFileAsync(authToken, Date.now() + 1, submission).then(\n    (res) =\u003e logSuccess(\"submitFileAsync\", res),\n    (err) =\u003e {\n      logError(\"submitFileAsync\", err);\n    }\n  );\n}\n\nmain().catch(err =\u003e console.error(err));\n```\nFor a full guide please refer to our step by step [Guide](https://docs.copyleaks.com/guides/authenticity/detect-plagiarism-text)\n\nFor a detailed understanding of the plagiarism detection process, refer to the Copyleaks Submit Endpoint [Documentation](https://docs.copyleaks.com/reference/actions/scans/submit-file)\n##\n### AI-Generated Text Detection\nUse the AI detection client to determine if content was generated by artificial intelligence.\n\n```javascript\nconst { Copyleaks,CopyleaksNaturalLanguageSubmissionModel } = require('plagiarism-checker');\n\n// --- Your Credentials ---\nconst EMAIL_ADDRESS = 'YOUR_EMAIL_ADDRESS';\nconst KEY = 'YOUR_API_KEY';\n// --------------------\n\nasync function main() {\n  const sampleText =\n    \"Lions are social animals, living in groups called prides, typically consisting of several females, their offspring, and a few males. Female lions are the primary hunters, working together to catch prey. Lions are known for their strength, teamwork, and complex social structures.\";\n  const submission = new CopyleaksNaturalLanguageSubmissionModel(sampleText);\n  submission.sandbox = true;\n\n  copyleaks.aiDetectionClient\n    .submitNaturalTextAsync(authToken, Date.now() + 1, submission)\n    .then((response) =\u003e {\n      logSuccess(\"TEST_submitAIDetectionNaturalLanguage\", response);\n    })\n    .catch((error) =\u003e {\n      logError(\"TEST_submitAIDetectionNaturalLanguage\", error);\n    });\n\n}\n\nmain().catch(err =\u003e console.error(err));\n```\nFor a full guide please refer to our step by step [Guide](https://docs.copyleaks.com/guides/ai-detector/ai-text-detection/)\n\nFor a detailed understanding of the Ai detection process, refer to the Copyleaks detect natural language Endpoint [Documentation](https://docs.copyleaks.com/reference/actions/writer-detector/check/)\n##\n### Writing Assistant\nGet intelligent suggestions for improving grammar, spelling, style, and overall writing quality.\n\n```javascript\nconst { Copyleaks,CopyleaksWritingAssistantSubmissionModel } = require('plagiarism-checker');\n\n// --- Your Credentials ---\nconst EMAIL_ADDRESS = 'YOUR_EMAIL_ADDRESS';\nconst KEY = 'YOUR_API_KEY';\n// --------------------\n\nasync function main() {\n const sampleText =\n    \"Lions are the only cat that live in groups, called pride. A prides typically consists of a few adult males, several feales, and their offspring. This social structure is essential for hunting and raising young cubs. Female lions, or lionesses are the primary hunters of the prid. They work together in cordinated groups to take down prey usually targeting large herbiores like zbras, wildebeest and buffalo. Their teamwork and strategy during hunts highlight the intelligence and coperation that are key to their survival.\";\n  const submission = new CopyleaksWritingAssistantSubmissionModel(sampleText);\n  submission.sandbox = true;\n\n  copyleaks.writingAssistantClient\n    .submitTextAsync(authToken, Date.now() + 1, submission)\n    .then((response) =\u003e {\n      logSuccess(\"TEST_submitWritingAssistText\", response);\n    })\n    .catch((error) =\u003e {\n      logError(\"TEST_submitWritingAssistText\", error);\n    });\n}\n\nmain().catch(err =\u003e console.error(err));\n```\nFor a full guide please refer to our step by step [Guide](https://docs.copyleaks.com/guides/writing/check-grammar/)\n\nFor a detailed understanding of the Writing assistant process, refer to the Copyleaks writing feedback Endpoint [Documentation](https://docs.copyleaks.com/reference/actions/writing-assistant/check/)\n##\n### Text Moderation\nScan and moderate text content for unsafe, inappropriate, or policy-violating material across various categories.\n\n```javascript\nconst { Copyleaks,CopyleaksWritingAssistantSubmissionModel } = require('plagiarism-checker');\n\n// --- Your Credentials ---\nconst EMAIL_ADDRESS = 'YOUR_EMAIL_ADDRESS';\nconst KEY = 'YOUR_API_KEY';\n// --------------------\n\nasync function main() {\n  \n    var labelsArray=[\n            new CopyleaksTextModerationLabel(CopyleaksTextModerationConstants.ADULT_V1),\n            new CopyleaksTextModerationLabel(CopyleaksTextModerationConstants.TOXIC_V1),\n            new CopyleaksTextModerationLabel(CopyleaksTextModerationConstants.VIOLENT_V1),\n            new CopyleaksTextModerationLabel(CopyleaksTextModerationConstants.PROFANITY_V1),\n            new CopyleaksTextModerationLabel(CopyleaksTextModerationConstants.SELF_HARM_V1),\n            new CopyleaksTextModerationLabel(CopyleaksTextModerationConstants.HARASSMENT_V1),\n            new CopyleaksTextModerationLabel(CopyleaksTextModerationConstants.HATE_SPEECH_V1),\n            new CopyleaksTextModerationLabel(CopyleaksTextModerationConstants.DRUGS_V1),\n            new CopyleaksTextModerationLabel(CopyleaksTextModerationConstants.FIREARMS_V1),\n            new CopyleaksTextModerationLabel(CopyleaksTextModerationConstants.CYBERSECURITY_V1)\n        ];\n\n    const model = new CopyleaksTextModerationRequestModel({\n        text: \"This is some text to scan.\",\n        sandbox: true,\n        language: CopyleaksTextModerationLanguages.ENGLISH,\n        labels:labelsArray\n    });\n\n    copyleaks.textModerationClient.submitTextAsync(authToken, Date.now() + 1, model)\n      .then(response =\u003e {\n        logSuccess('TEST_submitTextModerationText', JSON.stringify(response, null, 2));\n      })\n      .catch(error =\u003e {\n        logError('TEST_submitTextModerationText', error);\n      });\n}\n\nmain().catch(err =\u003e console.error(err));\n```\nFor a full guide please refer to our step by step [Guide](https://docs.copyleaks.com/guides/moderation/moderate-text/)\n\nFor a detailed understanding of the Text moderation process, refer to the Copyleaks text moderation Endpoint [Documentation](https://docs.copyleaks.com/reference/actions/text-moderation/check/)\n##\n### AI Image Detection\nDetermine if a given image was generated or partially generated by an AI.\n\n```javascript\nconst { Copyleaks, CopyleaksAiImageDetectionRequestModel } = require('plagiarism-checker');\n\n// --- Your Credentials ---\nconst EMAIL_ADDRESS = 'YOUR_EMAIL_ADDRESS';\nconst KEY = 'YOUR_API_KEY';\n// --------------------\n\nasync function main() {\n\n  console.log(\"Submitting a new image for AI image detection...\");\n  \n  // Read and encode your image file to base64\n  const fs = require('fs');\n  const imagePath = \"path/to/your/image.jpg\"; // Update this path to your image\n  const base64Image = fs.readFileSync(imagePath, { encoding: 'base64' });\n  \n  const model = new CopyleaksAiImageDetectionRequestModel(\n    base64Image,\n    \"sample-image.jpg\",\n    CopyleaksAiImageDetectionModels.AI_IMAGE_1_ULTRA,\n    true // sandbox mode\n  );\n\n  copyleaks.aiImageDetectionClient\n    .submitAsync(authToken, Date.now() + 1, model)\n    .then(response =\u003e {\n      console.log('AI Image Detection Response:', JSON.stringify(response, null, 2));\n    })\n    .catch(error =\u003e {\n      console.error('AI Image Detection Error:', error);\n    });\n}\n\nmain().catch(err =\u003e console.error(err));\n```\nFor a full guide please refer to our step by step [Guide](https://docs.copyleaks.com/guides/ai-detector/ai-image-detection/)\n\nFor a detailed understanding of the AI image detection process, refer to the Copyleaks AI image detection Endpoint [Documentation](https://docs.copyleaks.com/reference/actions/ai-image-detector/check/)\n\n##\n### Further Resources\n\n*   **Copyleaks API Dashboard:** Manage your API keys, monitor usage, and view analytics from your personalized dashboard. [Access Dashboard](https://api.copyleaks.com/dashboard)\n*   **Copyleaks SDK Documentation:** Explore comprehensive guides, API references, and code examples for seamless integration. [Read Documentation](https://docs.copyleaks.com/resources/sdks/overview/)\n\n\n## Support\n* If you need assistance, please contact Copyleaks Support via our support portal: Contact Copyleaks [Support](https://help.copyleaks.com/s/contactsupport).\n* To arrange a product demonstration, book a demo here: [Booking Link](https://copyleaks.com/book-a-demo).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcopyleaks%2Fnodejs-plagiarism-checker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcopyleaks%2Fnodejs-plagiarism-checker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcopyleaks%2Fnodejs-plagiarism-checker/lists"}