
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
impequid-api
Advanced tools
A JavaScript/Node.js API to easily interact with Impequid.
Works best with WebPack or Node.js.
Completely Promise-based, making it easy to interact with it, especially using yield and await.
import ImpequidAPI from 'impequid-api';
const iqa = new ImpequidAPI({token});
The following API method examples assume the above code is present.
In addition to that, they also omit this:
.catch(error => {
console.error('something went wrong', error);
});
If you want or need error handling, you should definitely not omit that code.
none]iqa.verify().then({isValid, userId} => {
console.log(`Token is ${isValid ? '' : 'not '}valid`);
});
user.id, user.name]Beware that usernames may change. If you want to store information about a user, store it using the userId and impequidServer.
Depending on your permissions you may get less information.
iqa.getUser().then(user => {
// Object user
// String user.name [user.name]
// String user.id [user.id] (usually convertable to Mongo's ObjectId)
});
any:background]Fetch a background-access token from the server. This token can be used until the user revokes it and never gets IP-blocked.
The permission scope of a background-access token is completely separate from a client-access token.
For example: if you want to notify users about changes in the background, you should request the background.notify permission.
Tip: You can easily spot a background token, because it begins with the letter d, while the normal token begins with a n.
iqa.getBackgroundToken().then(token => {
// String token
// you may switch to the background token
iqa.token = token;
});
none]Gets or sets the used token. Useful if you want to switch to a background-token or if you want to use one ImpequidAPI instance for multiple users.
iqa.token = token;
console.log(iqa.token);
notify]Sends a notification to the user.
iqa.notify({
message: 'Something you want the user to know',
priority: -1, // low = -1, normal = 0, high = 1
url: 'https://:appServer/api/redirect/:someToken'
// You can use the above URL to instantly trigger an action when the user clicks the link
}).then(() => {
// it worked
});
none]Retrieves all permissions associated to the token.
iqa.getPermissions().then(permissions => {
// Object permissions
// Example:
// {
// notify: true,
// user: {
// id: true
// },
// background: true
// }
// note that `user: true` also grants user.id
// see exported function hasPermission to easily check
// for a particular permission
});
none]Allows you to request new permissions. If you set a permission to false it will get disabled for your app.
The following example will request user.name permissions for the normal and background tokens. It will also disable the background.notify permission.
When requesting permissions, it's recommended to be as specific as possible, since you will otherwise get unnecessary permissions and users are more likely to decline your request.
iqa.requestPermissions({
user: {
name: true
},
background: {
user: {
name: true,
id: true
},
notify: false
}
})
none]const isBackground = iqa.isBackground();
console.log(`API is ${isBackground ? '' : 'not '}running in background mode.`).
import {ServiceProvider} from 'impequid-api';
const isp = new ServiceProvider();
isp.get('dns.smartfl.at').then(service => {
console.log(service);
}).catch(error => {
console.error('could not fetch service data');
});
FAQs
API to easily interact with impequid.
We found that impequid-api 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.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.