npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

fatin_ca

v1.0.9

Published

Character AI Unofficial API for Mass Usage

Downloads

33

Readme

fatin_ca - Character AI Unofficial API for Mass Usage

https://github.com/Fatin1st/fatin_ca

fatin_ca is a Node.js module for character.ai, built for Mass Usage and unlimited user handling. It is inspired by the node_characterai module, designed to provide a simplified interface for creating and managing chat threads with CharacterAI. One of its key features is the ability to handle mass usage and support unlimited users seamlessly.

Installation

To install the fatin_ca module, use the following command:

npx fatin_ca init

Usage

Here's an example code snippet demonstrating how to use the fatin_ca module:

const fatin = require("fatin_ca");

const userId1 = "2009-09-27";
const userId2 = "2009-09-28";
const characterId = "8_1NyR8w1dOXmI1uWaieQcd147hecbdIK7CeEAIrdJw";

// Create new chat for User 1
fatin.createNewChat(userId1, (threadName) => {
  console.log(`Thread Name for User 1: ${threadName}`);
});

// Create new chat for User 1
fatin.createNewChat(userId2, (threadName) => {
  console.log(`Thread Name for User 2: ${threadName}`);
});

// Start chat for User 1
fatin.startOrContinueChat(
  userId1,
  "Hello from User 1",
  characterId,
  (response) => {
    console.log(`Response for User 1: ${JSON.stringify(response)}`);

    // Continue chat for User 1
    fatin.startOrContinueChat(
      userId1,
      "How are you?",
      characterId,
      (response) => {
        console.log(`Response for User 1: ${JSON.stringify(response)}`);
        fatin.deleteChat(userId1); // Delete chat for User 1
      }
    );
  }
);

// Start chat for User 2
fatin.startOrContinueChat(
  userId2,
  "Hello from User 2",
  characterId,
  (response) => {
    console.log(`Response for User 2: ${JSON.stringify(response)}`);

    // Continue chat for User 2
    fatin.startOrContinueChat(
      userId2,
      "Who are you?",
      characterId,
      (response) => {
        console.log(`Response for User 2: ${JSON.stringify(response)}`);
        fatin.deleteChat(userId2); // Delete chat for User 2
      }
    );
  }
);

Finding your character's ID

You can find your character ID in the URL of a Character's chat page.

For example, if you go to the chat page of the character Discord Moderator you will see the URL https://beta.character.ai/chat?char=8_1NyR8w1dOXmI1uWaieQcd147hecbdIK7CeEAIrdJw.

The last part of the URL is the character ID: Character_ID

Functions

createNewChat(userId)

Creates a new chat thread for the specified user.

  • userId (String): Unique identifier for the user.

startOrContinueChat(userId, userMessage, characterId)

Starts or continues an existing chat thread for the specified user.

  • userId (String): Unique identifier for the user.
  • userMessage (String): Message to send in the chat.
  • characterId (String): Unique identifier for the character.

deleteChat(userId)

Deletes chat thread for the specified user.

  • userId (String): Unique identifier for the user.

Response

Response is built in JSON with 3 parts

  • userId (String): Unique identifier for the user.
  • response (String): Actual response of the AI.
  • messageId (String): Unique identifier for the message.

Note

This module is designed for mass usage and can efficiently handle unlimited users. It uses Node.js workers to create separate environment for each user. Therefore, the performance of the module depends on the cores of the server.

🚀 About Me

I'm Fatin Hasnat, a 15-year-old talented and ambitious Cyber Security Expert, Full-stack Next.js Developer and Python Developer. Always open for new ideas!

🔗 Links

portfolio linkedin