Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
@cognite/cognitesdk
Advanced tools
Javascript client library for Cognite SDK
$ npm install --save cognitesdk
This injects an iframe into the
// Intially call the redirect function
cognitesdk.loginWithRedirect();
// get the token from the url
const token = some_querystring_parser('access_token');
// use that token for all subsequent calls to api
cognitesdk.setBearerToken(token)
// Figure out how long til the token expires
const decodedToken = jwtDecode(token);
const msToExpiration =
decodedToken.expire_time * 1000 - new Date().getTime();
/* Call silentlogin function some time before it expires
repeat every time you get a new token
This injcts an iframe into your page, and gets the token from the a redirect in that frame
Pass in the url to an empty html file for fastest load times.
*/
setTimeout(() => {
getAccessTokenFromSession('www.myapplication.com/empty.html')
}, msToExpiration - 5000);
const cognitesdk = require('cognitesdk');
cognitesdk.configure({
project,
version,
});
cognitesdk
.getProject()
.then(console.log)
.catch(console.error);
Use the command yarn release
This will build, bump version and release to npm.
The tests need an API key to make sure it's working. Create a file called
.secrets.json
in the root folder, looking like this:
{
"apikey": "..."
}
$ git clone git@github.com:cognitedata/cognitesdk-js
$ yarn
$ yarn test
FAQs
Javascript client library for Cognite SDK
The npm package @cognite/cognitesdk receives a total of 3 weekly downloads. As such, @cognite/cognitesdk popularity was classified as not popular.
We found that @cognite/cognitesdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 26 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
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.