Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
@nrfcloud/api-client-javascript
Advanced tools
JavaScript API client for the nRFCloud.com REST API
Provides the JavaScript API client for the nRFCloud.com REST API.
:warning: This is a preview release and might be changed without notice.
The API client is available on npm:
npm i @nrfcloud/api-client-javascript@preview
You also need to install the updated models.
npm i @nrfcloud/models@next
const {Client} = require('@nrfcloud/api-client-javascript')
const client = new Client(token);
client
.registerGateway('foo')
.then(res => {
console.log(res)
})
npm i isomorphic-fetch es6-promise
require('es6-promise').polyfill()
require('isomorphic-fetch')
const {Client} = require('@nrfcloud/api-client-javascript')
...
A testing API Gateway can provide an /token
endpoint which returns a
Cognito User Pool Identity Token so it is not required to use the AWS
Cognito SDK.
Example:
npm i @nrfcloud/api-client-javascript@preview @nrfcloud/models@next isomorphic-fetch es6-promise
require('es6-promise').polyfill();
require('isomorphic-fetch');
const { Client } = require('@nrfcloud/api-client-javascript');
const endpoint = 'https://1ewo2b2jmj.execute-api.us-east-1.amazonaws.com/dev';
const username = 'changeme'; // nrfcloud.com email
const password = 'changeme';
(async () => {
// This is an undocumented endpoint, which will only be on dev / test stages
const res = await fetch(`${endpoint}/token`, {
method: 'POST',
body: JSON.stringify({ username, password })
});
const { token } = await res.json();
// Construct a client
const client = new Client(token, endpoint);
client
.listTenants('true')
.then(([{ id }]) => client.registerGateway(id))
.then(res => {
console.log(res)
})
.catch(err => {
console.error(err)
})
})();
FAQs
JavaScript API client for the nRFCloud.com REST API
The npm package @nrfcloud/api-client-javascript receives a total of 3 weekly downloads. As such, @nrfcloud/api-client-javascript popularity was classified as not popular.
We found that @nrfcloud/api-client-javascript 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
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.