
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
@mapify/sdk
Advanced tools
The Mapify JS SDK library is a wrapper for the Mapify APIs, such as the Authorization API, allowing you to develop your Location Intelligence application and services using the javascript programming languages.
Mapify is a Location Intelligence Platform to prototype and develop large scalable enterprise solutions. It aggregates data from IOT sensing devices, modern and legacy information systems, enriching its value through location intelligence and machine learning layers to assist human decision on every imaginable use case while allowing virtually infinite platform extensibility.
Via npm
npm install @mapify/sdk
Via yarn.
yarn add @mapify/sdk
const { AuthenticationClient } = require(`@mapify/sdk`)
const authenticationClient = new AuthenticationClient({
publicKey: "/path/to/key.pub"
})
Note: Before you sign an Api Key, you must create one on Mapify Console
const { AuthenticationClient, Token } = require(`@mapify/sdk`)
const authenticationClient = new AuthenticationClient()
try{
const authorization = await authenticationClient.sign('apikey')
// Authentication token
authorization.authenticationToken
// Refresh token
authorization.refreshToken
// Authentication token expire date (UTC in seconds)
authorization.expires
// Decoded payload
tokenPayload = authenticationClient.decode(authorization.authenticationToken)
tokenPayload.apis //the apis
tokenPayload.payload //the custom payload
// List of Claims
const decodedToken = new Token(tokenPayload)
claims = token.getClaimsByApi('api')
}catch(e){
// * `HTTPException` its thrown wherever is a problem with a Sign.
}
const { AuthenticationClient } = require(`@mapify/sdk`)
const authenticationClient = new AuthenticationClient()
try{
const customPayload = {
example: "example"
}
const token = await authenticationClient.sign('apikey', customPayload)
}catch(e){
// * `HTTPException` its thrown wherever is a problem with a Sign.
}
const { Handler, AuthenticationClient } = require(`@mapify/sdk`)
class AuthenticationHandler implements Handler {
construct(private readonly username, private readonly password) { }
execute(payload) {
return {
...payload,
basic_auth: new Buffer(`${this.username}:${this.password}`).toString('base64')
};
}
}
const authenticationClient = new AuthenticationClient()
authenticationClient.withHandler(new AuthenticationHandler(`user`, `password`))
try{
const authorization = await authenticationClient.sign('apikey')
// authorization code
}catch(e){
// * `HTTPException` its thrown wherever is a problem with a Sign.
}
const fs = require('fs')
const { Handler, AuthenticationClient } = require(`@mapify/sdk`)
const authenticationClient = new AuthenticationClient({
publicKey: fs.readFileSync(`${__dirname}/key.pub`, { encoding: 'utf8' })
})
try{
const isValid = authenticationClient.verify(`token`)
}catch(e){
// * `TokenExpiredError` Token is expired
// * `InvalidToken` Token is invalid with he public key
}
// Decode payload
tokenPayload = authenticationClient.decode(`token`)
tokenPayload.apis //the apis
tokenPayload.payload //the custom payload
// List of Claims
const decodedToken = new Token(tokenPayload)
claims = token.getClaimsByApi('api')
const fs = require('fs')
const { AuthenticationClient } = require(`@mapify/sdk`)
try{
const isValid = AuthenticationClient.verify(`token`, fs.readFileSync(`${__dirname}/key.pub`, { encoding: 'utf8' }))
}catch(e){
// * `TokenExpiredError` Token is expired
// * `InvalidToken` Token is invalid with he public key
}
const { AuthenticationClient } = require(`@mapify/sdk`)
try{
const authenticationClient = new AuthenticationClient()
const authorization = await authenticationClient.refresh(refreshToken)
}catch(e){
// * `HTTPException` its thrown wherever is a problem with a Sign.
}
This library throws exceptions to indicate problems:
HTTPException its thrown wherever is a problem with a Sign.TokenExpiredError Token is expiredInvalidToken Token is invalid with he public keynpm test
yarn install && yarn build && yarn test
docker build . -t mapify-js-sdk && \
docker run -it mapify-js-sdk sh -c "yarn test"
Please follow our contributor guide
This project is licensed under the terms of the Apache License Version 2.0, January 2004.
FAQs
Mapify javascript SDK
The npm package @mapify/sdk receives a total of 4 weekly downloads. As such, @mapify/sdk popularity was classified as not popular.
We found that @mapify/sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.