This js code will authenticate with your Gunbot instance and get a JWT token response. For development use in building out gunbot api needs.

1️⃣ Prerequisites

  • Node.js installed (v14+ recommended)
  • npm (comes with Node.js)
  • Your Gunbot password and Gunthy wallet key
  • Your Gunbot URL (e.g., http://127.0.0.1:5000 or your remote Gunbot server)

2️⃣ Save the Script

  1. Open your favorite text editor.
  2. download the final gbtoken-gen authentication script.
  3. Save it as:
gbtoken-gen.js

Example folder structure:

C:\gunbot\gbtoken-gen.js  (Windows)
~/gunbot/gbtoken-gen.js    (Linux)

3️⃣ Install Dependencies

Open a terminal/command prompt in the same folder as the script:

npm init -y
npm install axios readline-sync
  • axios → to make HTTP requests to Gunbot
  • readline-sync → to read password/wallet input securely

4️⃣ Running the Script

Windows (CMD or PowerShell)

  1. Open Command Prompt or PowerShell
  2. Navigate to the folder with the script:
cd C:\gunbot
  1. Run the script:
node gbtoken-gen.js
  1. You will be prompted to enter:
    • Gunbot password (input hidden)
    • Gunthy wallet key (input hidden)
    • Gunbot URL
  2. If successful, you will see:
🔐 Encrypted password: ENC:...
✅ Gunbot authentication successful.
JWT Token: eyJhbGciOi...

Linux (Ubuntu / Debian / CentOS / etc.)

  1. Open Terminal
  2. Navigate to your script folder:
cd ~/gunbot
  1. Run the script:
node gbtoken-gen.js
  1. Enter your credentials when prompted.

Files

sha256: EB3617605A674886EE4EFC8F4796A7E2FA4323E5F816463A098EB957DBCF3604

#soonish

This software is provided “as is” for testing and development purposes only. No liability is assumed by the developer for any resulting losses or damages. The use of this software is entirely at your own risk.