Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
@chaingpt/ainews
Advanced tools
Readme
This library provides convenient access to the ChainGPT AI News REST API from TypeScript or JavaScript.
npm install --save @chaingpt/ainews
# or
yarn add ainews
import { AINews } from '@chaingpt/ainews';
const ainews = new AINews({
apiKey: 'Your ChainGPT API Key',
});
async function main() {
const response = await ainews.getNews({});
console.log(response.data.rows);
}
main();
When the library is unable to connect to the API,
or if the API returns a non-success status code (i.e., 4xx or 5xx response),
an error of the class AINewsError
will be thrown:
import { Errors } from '@chaingpt/ainews';
async function main() {
try {
const response = await ainews.getNews({});
console.log(response.data.rows);
} catch(error) {
if (error instanceof Errors.AINewsError) {
console.log(error.message)
}
}
}
main();
FAQs
SDK for AINews
The npm package @chaingpt/ainews receives a total of 2 weekly downloads. As such, @chaingpt/ainews popularity was classified as not popular.
We found that @chaingpt/ainews demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.