{"id":37440007,"url":"https://github.com/nightfallai/nightfall-nodejs-sdk","last_synced_at":"2026-01-16T06:43:58.866Z","repository":{"id":37082390,"uuid":"412521921","full_name":"nightfallai/nightfall-nodejs-sdk","owner":"nightfallai","description":"NodeJS Data Loss Prevention (DLP) SDK - Nightfall Developer Platform","archived":false,"fork":false,"pushed_at":"2022-07-26T17:56:49.000Z","size":86,"stargazers_count":9,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-02T04:53:46.848Z","etag":null,"topics":["api","data-loss-prevention","data-privacy","data-protection","dlp","javascript","nodejs","sdk","secrets-detection","typescript"],"latest_commit_sha":null,"homepage":"https://docs.nightfall.ai","language":"TypeScript","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/nightfallai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null}},"created_at":"2021-10-01T15:31:37.000Z","updated_at":"2025-08-25T17:01:05.000Z","dependencies_parsed_at":"2022-07-19T18:04:30.946Z","dependency_job_id":null,"html_url":"https://github.com/nightfallai/nightfall-nodejs-sdk","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/nightfallai/nightfall-nodejs-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nightfallai%2Fnightfall-nodejs-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nightfallai%2Fnightfall-nodejs-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nightfallai%2Fnightfall-nodejs-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nightfallai%2Fnightfall-nodejs-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nightfallai","download_url":"https://codeload.github.com/nightfallai/nightfall-nodejs-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nightfallai%2Fnightfall-nodejs-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28477923,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T06:30:42.265Z","status":"ssl_error","status_checked_at":"2026-01-16T06:30:16.248Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["api","data-loss-prevention","data-privacy","data-protection","dlp","javascript","nodejs","sdk","secrets-detection","typescript"],"created_at":"2026-01-16T06:43:58.739Z","updated_at":"2026-01-16T06:43:58.846Z","avatar_url":"https://github.com/nightfallai.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nightfall Node.js SDK\n\n![GitHub Workflow Status](https://img.shields.io/github/workflow/status/nightfallai/nightfall-nodejs-sdk/test)\n![GitHub](https://img.shields.io/github/license/nightfallai/nightfall-nodejs-sdk)\n\n**Embed Nightfall scanning and detection functionality into Node.js applications**\n\n## Features\n\nThis SDK provides JavaScript/TypeScript bindings for the Nightfall API. It allows you to add functionality to your applications to\nscan plain text and files in order to detect different categories of information. You can leverage any of\nthe detectors in Nightfall's pre-built library, or you may programmatically define your own custom detectors.\n\nAdditionally, this library provides convenience features such as encapsulating the steps to chunk and upload files.\n\nTo obtain an API Key, login to the [Nightfall dashboard](https://app.nightfall.ai/) and click the section\ntitled \"Manage API Keys\".\n\nSee our [developer documentation](https://docs.nightfall.ai/docs/entities-and-terms-to-know) for more details about\nintegrating with the Nightfall API.\n\n## Dependencies\n\nThe Nightfall Node.js SDK is compiled to ES2018 and supports Node.js v10.0.0 or later.\n\nFor a full list of external dependencies please consult `package.json`.\n\n## Installation\n\n### NPM\n\n`npm install nightfall-js`\n\n### Yarn\n\n`yarn add nightfall-js`\n\n### Building Locally\n\nAlternatively, if you would like to build the project yourself:\n\n1. Clone this git repository\n2. Run `npm install` from the top-level directory\n3. Run `npm run build` to compile the TypeScript codebase into the ./dist folder (in some cases, you may be required to manually create the ./dist folder before you run this command)\n4. Import the client like so: `import { Nightfall } from './dist'`\n\n## Usage\n\n### Scanning Plain Text\n\nNightfall provides pre-built detector types, covering data types ranging from PII to PHI to credentials. The following snippet shows an example of how to scan using pre-built detectors.\n\n#### Sample Code\n\n```typescript\n// By default, the client reads your API key from the environment variable NIGHTFALL_API_KEY\nconst nfClient = new Nightfall();\n\nconst response = await nfClient.scanText(['My credit card number is 4242-4242-4242-4242'], {\n  detectionRules: [\n    {\n      name: 'Secrets Scanner',\n      logicalOp: 'ANY',\n      detectors: [\n        {\n          minNumFindings: 1,\n          minConfidence: Detector.Confidence.Possible,\n          displayName: 'Credit Card Number',\n          detectorType: Detector.Type.Nightfall,\n          nightfallDetector: 'CREDIT_CARD_NUMBER',\n        },\n      ],\n    },\n  ],\n});\n\nif (response.isError) {\n  console.log(response.getError());\n} else {\n  response.data.findings.forEach((finding) =\u003e {\n    if (finding.length \u003e 0) {\n      finding.forEach((result) =\u003e {\n        console.log(`Finding: ${result.finding}, Confidence: ${result.confidence}`);\n      });\n    }\n  });\n}\n```\n\n### Scanning Files\n\nScanning common file types like PDF's or office documents typically requires cumbersome text\nextraction methods like OCR.\n\nRather than implementing this functionality yourself, the Nightfall API allows you to upload the\noriginal files, and then we'll handle the heavy lifting.\n\nThe file upload process is implemented as a series of requests to upload the file in chunks. This library\nprovides a single method that wraps the steps required to upload your file. Please refer to the\n[API Reference](https://docs.nightfall.ai/reference) for more details.\n\nThe file is uploaded synchronously, but as files can be arbitrarily large, the scan itself is conducted asynchronously.\nThe results from the scan are delivered by webhook; for more information about setting up a webhook server, refer to\n[the docs](https://docs.nightfall.ai/docs/creating-a-webhook-server).\n\n#### Sample Code\n\n```typescript\n// By default, the client reads your API key from the environment variable NIGHTFALL_API_KEY\nconst nfClient = new Nightfall();\n\nconst response = await nfClient.scanFile('./customer-details.txt', {\n  detectionRules: [\n    {\n      name: 'Secrets Scanner',\n      logicalOp: 'ANY',\n      detectors: [\n        {\n          minNumFindings: 1,\n          minConfidence: Detector.Confidence.Possible,\n          displayName: 'Credit Card Number',\n          detectorType: Detector.Type.Nightfall,\n          nightfallDetector: 'CREDIT_CARD_NUMBER',\n        },\n      ],\n    },\n  ],\n  webhookURL: 'https://my-service.com/nightfall/listener',\n});\n\nif (response.isError) {\n  console.log(response.getError());\n}\n\n// Save this ID to check for findings when you receive a webhook event from us\nconsole.log(response.data.id);\n```\n\n## Contributing\n\nContributions are welcome! Open a pull request to fix a bug, or open an issue to discuss a new feature\nor change.\n\nRefer to `CONTRIBUTING.md` for the full details.\n\n## License\n\nThis code is licensed under the terms of the MIT License. See [here](https://opensource.org/licenses/MIT)\nfor more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnightfallai%2Fnightfall-nodejs-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnightfallai%2Fnightfall-nodejs-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnightfallai%2Fnightfall-nodejs-sdk/lists"}