The Google Safe Browsing NodeJS Wrapper is a concise and efficient tool for interacting with Google's Safe Browsing API v4 using Node.js. This wrapper simplifies the process of checking whether a given URL is associated with malicious content.
Install the package via npm:
npm install gsb-node
const GSBNode = require('gsb-node');
// Initialize with your Google Safe Browsing API key
const gsb = new GSBNode({ apiKey: 'your-api-key' });
For comprehensive information on the Google Safe Browsing API v4, refer to the official documentation.
const gsb = new GSBNode({ apiKey: 'your-api-key' });
const maliciousURLs = await gsb.lookup(['https://example.com/malicious']);
console.log('Malicious URLs:', maliciousURLs);
or check this testing example here.
To create a Google Safe Browsing API key, follow these steps:
- Go to the Google Cloud Console.
- Create a new project or select an existing one.
- Enable the "Safe Browsing API" for your project.
- Create credentials and generate an API key.
For more details, refer to the official guide.
Feel free to contribute to this project by submitting issues or pull requests on the GitHub repository.
This wrapper aims to provide a seamless integration with the Google Safe Browsing API v4, making it easier for Node.js developers to enhance the security of their applications.
This project is licensed under the MIT License - see the LICENSE file for details.