
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
@apilayer/userstack
Advanced tools
Userstack provides an API to Detect any Browser, Device & OS in Real-Time
Userstack provides an API to Detect any Browser, Device & OS in Real-Time
Using npm
npm install --save @apilayer/userstack
or yarn
yarn add @apilayer/userstack
Head over to Userstack and create an account. Copy access key from dashboard.
import userstack from '@apilayer/userstack'
const useHTTPs = false
const layer = new userstack("<your-access-key>", useHTTPs)
detect
detect
Look up any given User-Agent string.
Signature:
detect(ua: string): Promise<Response>
Example:
const response = layer.detect("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36")
console.log('response:', response)
Response:
{
ua: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36",
type: "browser",
brand: "Apple",
name: "Mac",
url: "https://www.google.com/about/company/",
os: {
name: "macOS 10.14 Mojave",
code: "macos_10_14",
url: "https://en.wikipedia.org/wiki/MacOS_Mojave",
family: "macOS",
family_code: "macos",
family_vendor: "Apple Inc.",
icon: "https://assets.userstack.com/icons/os/macosx.png",
icon_large: "https://assets.userstack.com/icons/os/macosx_big.png"
},
device: {
is_mobile_device: false,
type: "desktop",
brand: "Apple",
brand_code: "apple",
brand_url: "http://www.apple.com/",
name: "Mac"
},
browser: {
name: "Chrome",
version: "71.0.3578.98",
version_major: "71",
engine: "WebKit/Blink"
},
crawler: {
is_crawler: false,
category: null,
last_seen: null
}
}
BulkDetect
BulkDetect
Look up multiple User-Agent strings in bulk.
Signature:
bulkDetect(ua_batch: string[]): Promise<Response[]>
Example:
const response = layer.bulkDetect([
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36",
])
console.log('response:', response)
Response:
[{
ua: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36",
type: "browser",
brand: "Apple",
name: "Mac",
url: "https://www.google.com/about/company/",
os: {
name: "macOS 10.14 Mojave",
code: "macos_10_14",
url: "https://en.wikipedia.org/wiki/MacOS_Mojave",
family: "macOS",
family_code: "macos",
family_vendor: "Apple Inc.",
icon: "https://assets.userstack.com/icons/os/macosx.png",
icon_large: "https://assets.userstack.com/icons/os/macosx_big.png"
},
device: {
is_mobile_device: false,
type: "desktop",
brand: "Apple",
brand_code: "apple",
brand_url: "http://www.apple.com/",
name: "Mac"
},
browser: {
name: "Chrome",
version: "71.0.3578.98",
version_major: "71",
engine: "WebKit/Blink"
},
crawler: {
is_crawler: false,
category: null,
last_seen: null
}
}]
FAQs
Userstack provides an API to Detect any Browser, Device & OS in Real-Time
We found that @apilayer/userstack demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.