
Security News
Bun 1.2.19 Adds Isolated Installs for Better Monorepo Support
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.
spypoint-api-wrapper
Advanced tools
A simple Node.js wrapper for the Spypoint game camera API
import SpypointClient from 'spypoint-api-wrapper'
const Spypoint = new SpypointClient()
await Spypoint.login('YOUR_EMAIL_OR_USERNAME', 'YOUR_PASSWORD')
import SpypointClient from './spypoint.js'
// Send user crederntials to login route and set auth token on the cookie
router.post('/login', async (req, res) => {
const Spypoint = new SpypointClient()
const bearer = await Spypoint.login(req.body.email, req.body.password)
res.cookie('authorization', bearer, {
expire: '2100-01-01T00:00:00.000Z,
httpOnly: process.env.NODE_ENV === 'production' ? true : false
})
res.send()
})
// Middleware to pass auth token for requestsg
const SpypointInit = (req, res, next) => {
if (!req.cookies.authorization) throw Error('You need to login with valid credentials first!')
req.Spypoint = new SpypointClient(req.cookies.authorization)
next()
}
router.get('/', SpypointInit, (req, res) => {
const cameras = await req.Spypoint.cameras()
res.send(cameras)
})
Promise.<string>
Returns: Promise.<string>
- Bearer token used for authorization (this is automatically set and added to all requests)
Promise.<Array>
Returns: Promise.<Array>
- List of all available cameraId
s
Promise.<Object>
Returns: Promise.<Object>
- Object containing a property .species
w/ list of all available filter tags
Promise.<Array>
Returns: Promise.<Array>
- List of most recent photo taken from each camera
Promise.<Array>
Returns: Promise.<Array>
- List of photos from an individual camera
Param | Type | Description |
---|---|---|
cameraId | string | Unique identifier for the camera to request photos from |
[options] | Object | Options object |
[options.tags] | Array | string | Array of filter tag options or a single tag as a string |
[options.limit] | Number | Maximum number of results to return |
Promise.<Array>
Returns: Promise.<Array>
- List of photo by individual camera
Param | Type | Description |
---|---|---|
[options] | Object | Options object |
[options.tags] | Array | string | Array of filter tag options or a single tag as a string |
[options.limit] | Number | Maximum number of results to return |
FAQs
Node.js wrapper for the Spypoint game camera API
The npm package spypoint-api-wrapper receives a total of 28 weekly downloads. As such, spypoint-api-wrapper popularity was classified as not popular.
We found that spypoint-api-wrapper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.
Security News
Popular npm packages like eslint-config-prettier were compromised after a phishing attack stole a maintainer’s token, spreading malicious updates.
Security News
/Research
A phishing attack targeted developers using a typosquatted npm domain (npnjs.com) to steal credentials via fake login pages - watch out for similar scams.