🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

chat-gpt-authenticator

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chat-gpt-authenticator

OpenAI Authentication Library for ChatGPT

0.5.0
latest
Version published
Maintainers
1
Created

CI Workflow

ChatGPT Authenticator

This node library is based on this python implementation.

How to use

Create an Open AI account in this link.

Methods

//requests a new token or return a token that has already been fetched
chatGPTAuthTokenService.getToken() : <Promise>

//requests a new token
chatGPTAuthTokenService.refreshToken() : <Promise>

ES Modules

import { ChatGPTAuthTokenService } from "chat-gpt-authenticator";

const chatGptAuthTokenService = new ChatGPTAuthTokenService(
  "OPEN_AI_EMAIL",
  "OPEN_AI_PASSWORD"
);

(async () => {
  const token = await chatGptAuthTokenService.getToken();
  console.log(token);

  token = await chatGPTAuthTokenService.refreshToken();
  console.log(token);
})();

Common JS

const { ChatGPTAuthTokenService } = require("chat-gpt-authenticator");

const chatGPTAuthTokenService = new ChatGPTAuthTokenService(
  "OPEN_AI_EMAIL",
  "OPEN_AI_PASSWORD"
);

(async () => {
  let token = await chatGPTAuthTokenService.getToken();
  console.log(token);

  token = await chatGPTAuthTokenService.refreshToken();
  console.log(token);
})();

FAQs

Package last updated on 27 Feb 2023

Did you know?

Socket

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.

Install

Related posts