https://github.com/hckhanh/google-safe-browsing
A JavaScript client for Google Safe Browsing API
https://github.com/hckhanh/google-safe-browsing
api browser browsing cloud google safe safe-browsing safety server web website
Last synced: 17 days ago
JSON representation
A JavaScript client for Google Safe Browsing API
- Host: GitHub
- URL: https://github.com/hckhanh/google-safe-browsing
- Owner: hckhanh
- License: mit
- Created: 2024-03-01T09:10:47.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2026-05-23T04:12:26.000Z (about 1 month ago)
- Last Synced: 2026-05-23T06:26:11.947Z (about 1 month ago)
- Topics: api, browser, browsing, cloud, google, safe, safe-browsing, safety, server, web, website
- Language: TypeScript
- Homepage: https://jsr.io/@hckhanh/google-safe-browsing
- Size: 242 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# google-safe-browsing [](https://jsr.io/@hckhanh/google-safe-browsing)
[](https://sonarcloud.io/summary/new_code?id=hckhanh_google-safe-browsing)
A JavaScript client for [Google Safe Browsing](https://safebrowsing.google.com) [API](https://developers.google.com/safe-browsing)
## Features
- [Zero dependencies](https://jsr.io/@hckhanh/google-safe-browsing/dependencies)
- Built-in support for Edge runtime
- Typesafe with TypeScript
- Supports some common cases
- Fully documented
## APIs
### threatMatches.find
Finds the threat entries that match the Safe Browsing lists.
```ts
import { GoogleSafeBrowsing } from '@hckhanh/google-safe-browsing'
const client = new GoogleSafeBrowsing('apiKey')
const result = await client.findThreatMatches({
client: {
clientId: 'uniqueClientId',
clientVersion: '1.0.0',
},
threatInfo: {
threatTypes: ['MALWARE', 'SOCIAL_ENGINEERING'],
platformTypes: ['ALL_PLATFORMS'],
threatEntryTypes: ['URL'],
threatEntries: [
{ url: 'http://malware.testing.google.test/testing/malware/' },
],
},
})
const hasRisk = result.matches !== undefined && result.matches.length > 0
```
## Release Notes
You can go to the [Releases](https://github.com/hckhanh/google-safe-browsing/releases) page to see the release notes.
> [!NOTE]
> Enables client applications to check web resources (most commonly URLs)
> against Google-generated lists of unsafe web resources.
> The Safe Browsing APIs are for non-commercial use only.
> If you need to use APIs to detect malicious URLs for commercial purposes –
> meaning “for sale or revenue-generating purposes” –
> please refer to the [Web Risk API](https://github.com/hckhanh/google-web-risk).