
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
chatgpt-plus-unofficial-client
Advanced tools
Node.js Open Source project for making API calls to ChatGPT using TypeScript
This is a Node.js Open Source project for making API calls to ChatGPT. The project uses the paid version of ChatGPT (AKA ChatGPT Plus), making it easier to use without having to worry about the limitations of the free version.
To install the project, run the following command in your terminal:
npm install chatgpt-plus-api-client
To make API calls to ChatGPT in TypeScript, use the following code in your project:
import { sendPostRequest } from "chatgpt-plus-api-client";
async function talk() {
let conversationId, parentMessageId;
let response = await sendPostRequest({
prompt: "for loop in js?",
});
parentMessageId = response.message.id;
conversationId = response.conversation_id;
console.log(response.message.content.parts[0]);
response = await sendPostRequest({
prompt: "rewrite it in typescript",
parentMessageId,
conversationId,
});
parentMessageId = response.message.id;
console.log(response.message.content.parts[0]);
}
talk();
By default, the API client uses the Default model. There are 3 available models to choose from:
Default
Legacy
gpt-4
To choose a different model, simply pass in the model option in the sendPostRequest function, like so:
async function talk() {
const response = await sendPostRequest({
prompt: "for loop in js?",
model: "Legacy",
});
console.log(response.message.content.parts[0]);
}
talk();
async function talk() {
const response = await sendPostRequest({
prompt: `[Text from :https://medium.com/@anchen.li/creating-custom-shortcuts-on-your-mac-to-check-grammar-using-chatgpt-809c78715eda]
What is the article about?`,
model: "gpt-4",
});
console.log(response.message.content.parts[0]);
}
talk();
Before using the API client, you must set the CHATGPT_COOKIES and CHATGPT_AUTH_TOKEN environment variables. These values can be obtained by manually copying the cookies and authentication token from your browser requests.
_puid
cookie.CHATGPT_COOKIES
environment variable to the string _puid=[value]
.Note that these steps are specific to Google Chrome. If you are using a different web browser, the process for retrieving cookies may be slightly different.
Note that the exact steps may vary slightly between different browsers, but the overall process should be similar.
We welcome contributions to this project! If you have an idea for a new feature or a bug fix, please open a pull request.
This project is licensed under the MIT License.
FAQs
Node.js Open Source project for making API calls to ChatGPT using TypeScript
The npm package chatgpt-plus-unofficial-client receives a total of 0 weekly downloads. As such, chatgpt-plus-unofficial-client popularity was classified as not popular.
We found that chatgpt-plus-unofficial-client 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.