chat-gpt-authenticator
TypeScript icon, indicating that this package has built-in type declarations

0.5.0 • Public • Published

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);
})();

Readme

Keywords

none

Package Sidebar

Install

npm i chat-gpt-authenticator

Weekly Downloads

30

Version

0.5.0

License

MIT

Unpacked Size

76.3 kB

Total Files

8

Last publish

Collaborators

  • allanoricil