Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@auntodev/safe-browsing

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@auntodev/safe-browsing

A simple wrapper to talk to Google's Safe Browsing API.

latest
Source
npmnpm
Version
1.0.6
Version published
Weekly downloads
3
-92.86%
Maintainers
1
Weekly downloads
 
Created
Source

Install

To install this package, use npm install @auntodev/safe-browsing --save.

Getting started

First, you must require the package:

const SafeBrowsing = require('@auntodev/safe-browsing');

Now, you must provide your Google API credentials. Use the following to do this:

SafeBrowsing.authorize(
    'api_key', // Your Google API key
    'client_id' // Optional. If not provided, 'unknown' is used.
);

Finally, you can make a request:

// Async:
await SafeBrowsing.lookup('https://example.com');

// Then functions:
SafeBrowsing.lookup('https://example.com').then((result) => {
    /*
        {
            "url": "https://example.com",
            "type": "SAFE",
            "flagged": false
        }
    */
});

Output

When something isn't flagged, something similar will be given:

{
    "url": "https://example.com",
    "type": "SAFE",
    "flagged": false
}

When something is flagged, something similar will be given:

{
    "url": "https://example.com",
    "type": "MALWARE",
    "flagged": false
}

License and Disclaimers

Copyright (c) 2021 Aunto Development

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Google works to provide the most accurate and up-to-date information about
unsafe web resources. However, Google cannot guarantee that its information is
comprehensive and error-free: some risky sites may not be identified, and some
safe sites may be identified in error.

Keywords

safe

FAQs

Package last updated on 08 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts