{"_id":"3xui-api-client","_rev":"14-c3698e6a77a80ab3c0dd30f954f5cfc0","name":"3xui-api-client","dist-tags":{"latest":"3.2.1"},"versions":{"1.0.0":{"name":"3xui-api-client","version":"1.0.0","keywords":["3x-ui","3xui","api","client","vpn","proxy","panel","xray","v2ray","server-management","api-client","network-management"],"author":{"url":"https://github.com/iamhelitha","name":"Helitha Guruge","email":"helithalochana@gmail.com"},"license":"MIT","_id":"3xui-api-client@1.0.0","maintainers":[{"name":"iamhelitha","email":"helithalochana@gmail.com"}],"homepage":"https://github.com/iamhelitha/3xui-api-client#readme","bugs":{"url":"https://github.com/iamhelitha/3xui-api-client/issues"},"os":["linux","darwin","win32"],"dist":{"shasum":"0d4d12a8a9b9780e5760af9f04df3f17fce57102","tarball":"https://registry.npmjs.org/3xui-api-client/-/3xui-api-client-1.0.0.tgz","fileCount":8,"integrity":"sha512-GIbetKWAMBG4Rj+BGzTXel5jih3E3o8VcDlVdK8KDx/9pNoFRCtTWrV5jdSQhZE3dau9NIodUxo7e5qnEl/itQ==","signatures":[{"sig":"MEUCIQC1DzvXf+NGYNPP1048eP3GGnF5hi68O2u5zO721E6C1gIgPtOpfHaa23QwUQ14JKKBDUmMTz1tBl7Jjl4VfFqfYKU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":32009},"jest":{"testMatch":["**/tests/**/*.test.js"],"testEnvironment":"node","coverageDirectory":"coverage","collectCoverageFrom":["index.js"]},"main":"index.js","type":"commonjs","types":"index.d.ts","engines":{"npm":">=7.0.0","node":">=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"funding":{"url":"https://github.com/sponsors/iamhelitha","type":"github"},"gitHead":"01f3e6b415aa90fb76cdf24999becdc7a26a6ac4","scripts":{"lint":"eslint index.js","test":"jest","test:main":"node test/main-test.js","test:login":"node test/login-test.js","test:create":"node test/create-inbound-test.js","test:manual":"node test/main-test.js","test:inbounds":"node test/inbounds-test.js","prepublishOnly":"npm test"},"_npmUser":{"name":"iamhelitha","actor":{"name":"iamhelitha","type":"user","email":"helithalochana@gmail.com"},"email":"helithalochana@gmail.com"},"repository":{"url":"git+https://github.com/iamhelitha/3xui-api-client.git","type":"git"},"_npmVersion":"11.3.0","description":"A Node.js client library for 3x-ui panel API that provides easy-to-use methods for managing your 3x-ui server","directories":{},"_nodeVersion":"22.14.0","dependencies":{"axios":"^1.10.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","dotenv":"^16.5.0","eslint":"^9.0.0","@eslint/js":"^9.0.0"},"_npmOperationalInternal":{"tmp":"tmp/3xui-api-client_1.0.0_1750370451353_0.059697770275579654","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"3xui-api-client","version":"2.0.0","keywords":["3x-ui","3xui","api","client","vpn","proxy","panel","xray","v2ray","server-management","api-client","network-management","credential-generation","session-management","web-integration","express-middleware","nextjs","vless","vmess","trojan","shadowsocks","wireguard","reality"],"author":{"url":"https://github.com/iamhelitha","name":"Helitha Guruge","email":"helithalochana@gmail.com"},"license":"MIT","_id":"3xui-api-client@2.0.0","maintainers":[{"name":"iamhelitha","email":"helithalochana@gmail.com"}],"homepage":"https://github.com/iamhelitha/3xui-api-client#readme","bugs":{"url":"https://github.com/iamhelitha/3xui-api-client/issues"},"os":["linux","darwin","win32"],"dist":{"shasum":"67e07ca8bbc56313ec66281b12982b2a21f40da2","tarball":"https://registry.npmjs.org/3xui-api-client/-/3xui-api-client-2.0.0.tgz","fileCount":12,"integrity":"sha512-3PMWZe0SsZzFDBbgjlgnNKceZkALCZttTvCttMQ5ohSpkhbvpaRBZwd62WuSddidNSYtmSPLI0/F5ENIPuaxIw==","signatures":[{"sig":"MEUCIF7xF6dOQS0bYgaPRaHRWmdtc9Ge6ismZl1e/s8eunVBAiEAo/NuI+LaSetKUC6iBJwAS+awgA7l80ZJa8SH/c7eugA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":111038},"jest":{"testMatch":["**/test/**/*.js"],"testEnvironment":"node","coverageDirectory":"coverage","collectCoverageFrom":["index.js","src/**/*.js"]},"main":"index.js","type":"commonjs","types":"index.d.ts","engines":{"npm":">=7.0.0","node":">=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"funding":{"url":"https://github.com/sponsors/iamhelitha","type":"github"},"gitHead":"50d1bc70cc9447640eaddbf137457e216428f658","scripts":{"lint":"eslint index.js src/","test":"node test/main-test.js","test:jest":"jest","test:main":"node test/main-test.js","test:login":"node test/login-test.js","test:create":"node test/create-inbound-test.js","test:manual":"node test/main-test.js","test:inbounds":"node test/inbounds-test.js","prepublishOnly":"echo 'Skipping tests for publishing'"},"_npmUser":{"name":"iamhelitha","actor":{"name":"iamhelitha","type":"user","email":"helithalochana@gmail.com"},"email":"helithalochana@gmail.com"},"repository":{"url":"git+https://github.com/iamhelitha/3xui-api-client.git","type":"git"},"_npmVersion":"11.3.0","description":"A Node.js client library for 3x-ui panel API with built-in credential generation, session management, and web integration support","directories":{},"_nodeVersion":"22.14.0","dependencies":{"axios":"^1.10.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","dotenv":"^16.5.0","eslint":"^9.0.0","@eslint/js":"^9.0.0"},"_npmOperationalInternal":{"tmp":"tmp/3xui-api-client_2.0.0_1750884470451_0.493594625657356","host":"s3://npm-registry-packages-npm-production"}},"2.1.0":{"name":"3xui-api-client","version":"2.1.0","keywords":["3x-ui","3xui","api","client","vpn","proxy","panel","xray","v2ray","server-management","api-client","network-management","credential-generation","session-management","web-integration","express-middleware","nextjs","vless","vmess","trojan","shadowsocks","wireguard","reality"],"author":{"url":"https://github.com/iamhelitha","name":"Helitha Guruge","email":"helithalochana@gmail.com"},"license":"MIT","_id":"3xui-api-client@2.1.0","maintainers":[{"name":"iamhelitha","email":"helithalochana@gmail.com"}],"homepage":"https://github.com/iamhelitha/3xui-api-client#readme","bugs":{"url":"https://github.com/iamhelitha/3xui-api-client/issues"},"os":["linux","darwin","win32"],"dist":{"shasum":"85935e8f6573c8c91e61c1144ab7cd9380c7153e","tarball":"https://registry.npmjs.org/3xui-api-client/-/3xui-api-client-2.1.0.tgz","fileCount":12,"integrity":"sha512-okx4FsnYxf5TsuPO2i0EdoVO3Ff2EkMQmDZ7Nho2XQCs5oINOP1tE3I1ZGxaPXCNGCeZwgaH+YYzUqvonL6qqw==","signatures":[{"sig":"MEQCIAN+kX99StkNyFBOLVU/koN5+WYboZ1GBmO9VkYwu1ZCAiBqQgjW/TgfZs1hBMalrilyiklSHj2HALB0WMhPPx0CTw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":128558},"jest":{"testMatch":["**/test/**/*.js"],"testEnvironment":"node","coverageDirectory":"coverage","collectCoverageFrom":["index.js","src/**/*.js"]},"main":"index.js","type":"commonjs","types":"index.d.ts","engines":{"npm":">=7.0.0","node":">=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"funding":{"url":"https://github.com/sponsors/iamhelitha","type":"github"},"gitHead":"a677ad6f3901ce51950a6c4ae600fbf6c64ea2e0","scripts":{"lint":"eslint index.js src/","test":"node test/main-test.js","test:jest":"jest","test:main":"node test/main-test.js","test:login":"node test/login-test.js","test:create":"node test/create-inbound-test.js","test:manual":"node test/main-test.js","test:inbounds":"node test/inbounds-test.js","prepublishOnly":"echo 'Skipping tests for publishing'"},"_npmUser":{"name":"iamhelitha","email":"helithalochana@gmail.com"},"repository":{"url":"git+https://github.com/iamhelitha/3xui-api-client.git","type":"git"},"_npmVersion":"10.9.2","description":"A Node.js client library for 3x-ui panel API with built-in credential generation, session management, and web integration support","directories":{},"_nodeVersion":"22.17.0","dependencies":{"axios":"^1.10.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","dotenv":"^16.5.0","eslint":"^9.0.0","@eslint/js":"^9.0.0"},"_npmOperationalInternal":{"tmp":"tmp/3xui-api-client_2.1.0_1756554328769_0.38678862314100226","host":"s3://npm-registry-packages-npm-production"}},"2.1.1":{"name":"3xui-api-client","version":"2.1.1","keywords":["3x-ui","3xui","api","client","vpn","proxy","panel","xray","v2ray","server-management","api-client","network-management","credential-generation","session-management","web-integration","express-middleware","nextjs","vless","vmess","trojan","shadowsocks","wireguard","reality"],"author":{"url":"https://github.com/iamhelitha","name":"Helitha Guruge","email":"helithalochana@gmail.com"},"license":"MIT","_id":"3xui-api-client@2.1.1","maintainers":[{"name":"iamhelitha","email":"helithalochana@gmail.com"}],"homepage":"https://github.com/iamhelitha/3xui-api-client#readme","bugs":{"url":"https://github.com/iamhelitha/3xui-api-client/issues"},"os":["linux","darwin","win32"],"dist":{"shasum":"2342e712c5bd04ad220addb4eb2070bb6255a331","tarball":"https://registry.npmjs.org/3xui-api-client/-/3xui-api-client-2.1.1.tgz","fileCount":12,"integrity":"sha512-fVkEi46Fm0fznMBa4xF7fDO01ucYC3UU4v3+ag4ZLZ5SZBe0aJpGZ9j/Gg3j9tdfSOZ12C0u+wam18Vn9aJRYQ==","signatures":[{"sig":"MEQCIAVexwmQOeHqqb61SDXv+Rmnb+EQw9GALrt/1UQQru+qAiBZ62hm7lktIzWhZae/qk1aqcOd7zrbsfKkPob+cKESIQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":135055},"jest":{"testMatch":["**/test/**/*.js"],"testEnvironment":"node","coverageDirectory":"coverage","collectCoverageFrom":["index.js","src/**/*.js"]},"main":"index.js","type":"commonjs","types":"index.d.ts","engines":{"npm":">=7.0.0","node":">=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"funding":{"url":"https://github.com/sponsors/iamhelitha","type":"github"},"gitHead":"a61136a6b974e63c6ca1584cb8ddb73c3e96e7c5","scripts":{"lint":"eslint index.js src/","test":"node test/main-test.js","test:jest":"jest","test:main":"node test/main-test.js","test:login":"node test/login-test.js","test:create":"node test/create-inbound-test.js","test:manual":"node test/main-test.js","test:inbounds":"node test/inbounds-test.js","prepublishOnly":"echo 'Skipping tests for publishing'"},"_npmUser":{"name":"iamhelitha","email":"helithalochana@gmail.com"},"repository":{"url":"git+https://github.com/iamhelitha/3xui-api-client.git","type":"git"},"_npmVersion":"10.9.3","description":"A Node.js client library for 3x-ui panel API with built-in credential generation, session management, and web integration support","directories":{},"_nodeVersion":"22.20.0","dependencies":{"axios":"^1.10.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","dotenv":"^16.5.0","eslint":"^9.0.0","@eslint/js":"^9.0.0"},"_npmOperationalInternal":{"tmp":"tmp/3xui-api-client_2.1.1_1764494617878_0.9465490782276773","host":"s3://npm-registry-packages-npm-production"}},"3.0.1":{"name":"3xui-api-client","version":"3.0.1","keywords":["3x-ui","3xui","api","client","vpn","proxy","panel","xray","v2ray","server-management","api-client","network-management","credential-generation","session-management","web-integration","express-middleware","nextjs","vless","vmess","trojan","shadowsocks","wireguard","reality"],"author":{"url":"https://github.com/iamhelitha","name":"Helitha Guruge","email":"helithalochana@gmail.com"},"license":"MIT","_id":"3xui-api-client@3.0.1","maintainers":[{"name":"iamhelitha","email":"helithalochana@gmail.com"}],"homepage":"https://github.com/iamhelitha/3xui-api-client#readme","bugs":{"url":"https://github.com/iamhelitha/3xui-api-client/issues"},"os":["linux","darwin","win32"],"dist":{"shasum":"a53ccd570d5c175af21faedb5df5598b99fa6461","tarball":"https://registry.npmjs.org/3xui-api-client/-/3xui-api-client-3.0.1.tgz","fileCount":12,"integrity":"sha512-e9JtWXMfRu79CCGb+TMGxSOmemLUn7mu++t+gDW7enx8p1q/01N6sio4hcvLEGPxEjBimlZSmQ8W6gXweb8l7w==","signatures":[{"sig":"MEQCIBQkUxKC2ohn8IYRVrKLnyPFnZgfN+TWiOKQtuXfXgeEAiAovMCvTaftIABMcApRq++IlzBADQznADDnWh+AJKmaFA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/3xui-api-client@3.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":151595},"jest":{"testMatch":["**/test/**/*.js"],"testEnvironment":"node","coverageDirectory":"coverage","collectCoverageFrom":["index.js","src/**/*.js"]},"main":"index.js","type":"commonjs","types":"index.d.ts","engines":{"npm":">=7.0.0","node":">=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"funding":{"url":"https://github.com/sponsors/iamhelitha","type":"github"},"gitHead":"a15a9f91324df02087b17c3b7bbf6624d954bd98","scripts":{"lint":"eslint index.js src/","test":"node test/main-test.js","test:jest":"jest","test:main":"node test/main-test.js","test:login":"node test/login-test.js","test:create":"node test/create-inbound-test.js","test:manual":"node test/main-test.js","test:inbounds":"node test/inbounds-test.js","prepublishOnly":"echo 'Skipping tests for publishing'"},"_npmUser":{"name":"iamhelitha","email":"helithalochana@gmail.com"},"repository":{"url":"git+https://github.com/iamhelitha/3xui-api-client.git","type":"git"},"_npmVersion":"11.13.0","description":"A Node.js client library for 3x-ui panel API with built-in credential generation, session management, and web integration support","directories":{},"_nodeVersion":"24.16.0","dependencies":{"axios":"^1.10.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","dotenv":"^16.5.0","eslint":"^9.0.0","@eslint/js":"^9.0.0"},"_npmOperationalInternal":{"tmp":"tmp/3xui-api-client_3.0.1_1780828888858_0.7875158105298408","host":"s3://npm-registry-packages-npm-production"}},"3.1.0":{"name":"3xui-api-client","version":"3.1.0","keywords":["3x-ui","3xui","api","client","vpn","proxy","panel","xray","v2ray","server-management","api-client","network-management","credential-generation","session-management","web-integration","express-middleware","nextjs","vless","vmess","trojan","shadowsocks","wireguard","reality"],"author":{"url":"https://github.com/iamhelitha","name":"Helitha Guruge","email":"helithalochana@gmail.com"},"license":"MIT","_id":"3xui-api-client@3.1.0","maintainers":[{"name":"iamhelitha","email":"helithalochana@gmail.com"}],"homepage":"https://github.com/iamhelitha/3xui-api-client#readme","bugs":{"url":"https://github.com/iamhelitha/3xui-api-client/issues"},"os":["linux","darwin","win32"],"dist":{"shasum":"e9505a25724b67489260f5abd12de3786f9cdbf3","tarball":"https://registry.npmjs.org/3xui-api-client/-/3xui-api-client-3.1.0.tgz","fileCount":13,"integrity":"sha512-7Eqt99ayioHNrXyBqrd2HSTsOHJX0cZRrjXXGkQ9c+O7aPDLjPwgSXqS/sI21L9CXUhCDzkfVsZaH6dyhTwhuA==","signatures":[{"sig":"MEUCIQDvhFFuWBoCwCAEDDr/EW+cfAH5jT9znXRjK+SrQcCsJwIgRMnzkb+qvVBCDsBW6yaoOgQ2+BAnEgDu42zpWAH8LkQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/3xui-api-client@3.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":190124},"jest":{"testMatch":["**/test/**/*.js"],"testEnvironment":"node","coverageDirectory":"coverage","collectCoverageFrom":["index.js","src/**/*.js"]},"main":"index.js","type":"commonjs","types":"index.d.ts","engines":{"npm":">=7.0.0","node":">=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"funding":{"url":"https://github.com/sponsors/iamhelitha","type":"github"},"gitHead":"3fc8dbe1c9b004b5f7be86e89172a6b67d127c30","scripts":{"lint":"eslint index.js src/","test":"echo \"No automated tests configured. Tests require a live panel environment.\"","test:jest":"jest","prepublishOnly":"echo 'Skipping tests for publishing'"},"_npmUser":{"name":"iamhelitha","email":"helithalochana@gmail.com"},"repository":{"url":"git+https://github.com/iamhelitha/3xui-api-client.git","type":"git"},"_npmVersion":"11.13.0","description":"A Node.js client library for 3x-ui panel API with built-in credential generation, session management, and web integration support","directories":{},"_nodeVersion":"24.16.0","dependencies":{"axios":"^1.10.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.3.4","jest":"^29.7.0","dotenv":"^16.5.0","eslint":"^9.0.0","@eslint/js":"^9.0.0"},"_npmOperationalInternal":{"tmp":"tmp/3xui-api-client_3.1.0_1781515542140_0.41239545158920254","host":"s3://npm-registry-packages-npm-production"}},"3.1.1":{"name":"3xui-api-client","version":"3.1.1","keywords":["3x-ui","3xui","api","client","vpn","proxy","panel","xray","v2ray","server-management","api-client","network-management","credential-generation","session-management","web-integration","express-middleware","nextjs","vless","vmess","trojan","shadowsocks","wireguard","reality","3x-ui-client","3x-ui-api","xui-client","xui-api","xui","vpn-panel","vpn-api","vpn-client","rest-api-client","node","nodejs","typescript","sdk"],"author":{"url":"https://github.com/iamhelitha","name":"Helitha Guruge","email":"helithalochana@gmail.com"},"license":"Apache-2.0","_id":"3xui-api-client@3.1.1","maintainers":[{"name":"iamhelitha","email":"helithalochana@gmail.com"}],"homepage":"https://github.com/iamhelitha/3xui-api-client#readme","bugs":{"url":"https://github.com/iamhelitha/3xui-api-client/issues"},"os":["linux","darwin","win32"],"dist":{"shasum":"641a240225611de01a515082bbe96fef997a8648","tarball":"https://registry.npmjs.org/3xui-api-client/-/3xui-api-client-3.1.1.tgz","fileCount":12,"integrity":"sha512-vWBj1Ak0ZuF6439OHCsRD013UQi8EmLeH9dcp/HNIuKW99ePPj6BZbYcmRMi18ol18WLCPch6S4FRgebKuGmvg==","signatures":[{"sig":"MEUCIArp8BPAwLe7tAA6P0qphHc2sRq4Xp6dYpz1m4YOzUFMAiEA6yjqkdlSTJLFhtqaA7EuAlMse19E4rxW4WEiIOWbeq8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/3xui-api-client@3.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":201838},"jest":{"testMatch":["**/test/**/*.js"],"testEnvironment":"node","coverageDirectory":"coverage","collectCoverageFrom":["index.js","src/**/*.js"]},"main":"index.js","type":"commonjs","types":"index.d.ts","engines":{"npm":">=7.0.0","node":">=16.0.0"},"exports":{".":{"types":"./index.d.ts","default":"./index.js","require":"./index.js"}},"funding":{"url":"https://github.com/sponsors/iamhelitha","type":"github"},"gitHead":"73e4d13609559bc9ea86ab7951352b311fb87ac3","scripts":{"lint":"eslint index.js src/","test":"echo \"No automated tests configured. Tests require a live panel environment.\"","test:jest":"jest","prepublishOnly":"echo 'Skipping tests for publishing'"},"_npmUser":{"name":"iamhelitha","email":"helithalochana@gmail.com"},"repository":{"url":"git+https://github.com/iamhelitha/3xui-api-client.git","type":"git"},"_npmVersion":"11.13.0","description":"Node.js API client for the 3x-ui panel (VLESS, VMess, Trojan, Shadowsocks, WireGuard, Reality) with automatic session management, credential generation, and full REST API coverage","directories":{},"_nodeVersion":"24.16.0","dependencies":{"axios":"^1.10.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.3.4","jest":"^29.7.0","dotenv":"^16.5.0","eslint":"^9.0.0","@eslint/js":"^9.0.0"},"_npmOperationalInternal":{"tmp":"tmp/3xui-api-client_3.1.1_1781726066543_0.7003771842169568","host":"s3://npm-registry-packages-npm-production"}},"3.1.2":{"name":"3xui-api-client","version":"3.1.2","keywords":["3x-ui","3xui","api","client","vpn","proxy","panel","xray","v2ray","server-management","api-client","network-management","credential-generation","session-management","web-integration","express-middleware","nextjs","vless","vmess","trojan","shadowsocks","wireguard","reality","3x-ui-client","3x-ui-api","xui-client","xui-api","xui","vpn-panel","vpn-api","vpn-client","rest-api-client","node","nodejs","typescript","sdk"],"author":{"url":"https://github.com/iamhelitha","name":"Helitha Guruge","email":"helithalochana@gmail.com"},"license":"Apache-2.0","_id":"3xui-api-client@3.1.2","maintainers":[{"name":"iamhelitha","email":"helithalochana@gmail.com"}],"homepage":"https://github.com/iamhelitha/3xui-api-client#readme","bugs":{"url":"https://github.com/iamhelitha/3xui-api-client/issues"},"os":["linux","darwin","win32"],"dist":{"shasum":"627bd7c8705bb68b986779beb722ede2ce9ecb8e","tarball":"https://registry.npmjs.org/3xui-api-client/-/3xui-api-client-3.1.2.tgz","fileCount":12,"integrity":"sha512-1SQuJE14ig9dYv1EqOTvFbieSplXq6F1Rm28FJR4ZcPvKUbruF4a/tF09BEYmKF9dH0wG9aN5DLrhOdgsM/viQ==","signatures":[{"sig":"MEYCIQDe8I05ZTWqULFOgRG/6TgQBiofLO5+P4qWIUOFK+a1uAIhAJoSwhqmSVxwcaDhirxO4Lezn+1sClGWg2CHes5h0Mgu","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/3xui-api-client@3.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":208904},"jest":{"testMatch":["**/test/**/*.js"],"testEnvironment":"node","coverageDirectory":"coverage","collectCoverageFrom":["index.js","src/**/*.js"]},"main":"index.js","type":"commonjs","types":"index.d.ts","engines":{"npm":">=7.0.0","node":">=16.0.0"},"exports":{".":{"types":"./index.d.ts","default":"./index.js","require":"./index.js"}},"funding":{"url":"https://github.com/sponsors/iamhelitha","type":"github"},"gitHead":"e9d33fb5febd89ecde091485bc8a86f1c59597bb","scripts":{"lint":"eslint index.js src/","test":"echo \"No automated tests configured. Tests require a live panel environment.\"","test:jest":"jest","prepublishOnly":"echo 'Skipping tests for publishing'"},"_npmUser":{"name":"iamhelitha","email":"helithalochana@gmail.com"},"repository":{"url":"git+https://github.com/iamhelitha/3xui-api-client.git","type":"git"},"_npmVersion":"11.13.0","description":"Node.js API client for the 3x-ui panel (VLESS, VMess, Trojan, Shadowsocks, WireGuard, Reality) with automatic session management, credential generation, and full REST API coverage","directories":{},"_nodeVersion":"24.17.0","dependencies":{"axios":"^1.10.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.3.4","jest":"^29.7.0","dotenv":"^16.5.0","eslint":"^9.0.0","@eslint/js":"^9.0.0"},"_npmOperationalInternal":{"tmp":"tmp/3xui-api-client_3.1.2_1782800466535_0.6658386838338592","host":"s3://npm-registry-packages-npm-production"}},"3.2.0":{"name":"3xui-api-client","version":"3.2.0","keywords":["3x-ui","3xui","api","client","vpn","proxy","panel","xray","v2ray","server-management","api-client","network-management","credential-generation","session-management","web-integration","express-middleware","nextjs","vless","vmess","trojan","shadowsocks","wireguard","reality","3x-ui-client","3x-ui-api","xui-client","xui-api","xui","vpn-panel","vpn-api","vpn-client","rest-api-client","node","nodejs","typescript","sdk"],"author":{"url":"https://github.com/iamhelitha","name":"Helitha Guruge","email":"helithalochana@gmail.com"},"license":"Apache-2.0","_id":"3xui-api-client@3.2.0","maintainers":[{"name":"iamhelitha","email":"helithalochana@gmail.com"}],"homepage":"https://github.com/iamhelitha/3xui-api-client#readme","bugs":{"url":"https://github.com/iamhelitha/3xui-api-client/issues"},"os":["linux","darwin","win32"],"dist":{"shasum":"24f9817588a20be3ac68249b920c205ae154100e","tarball":"https://registry.npmjs.org/3xui-api-client/-/3xui-api-client-3.2.0.tgz","fileCount":12,"integrity":"sha512-mQFmBIRVGLtgtHXOHSyZSLXcXoJ0SPmNTeEYwYsYSkZrOEggwB5h4ezL6Icox99Q1b1c3bZ88PavNvxNDVUpGw==","signatures":[{"sig":"MEUCIHCbGYhnu35CyM5Lu2GOjThnaG8cnpFHCwo1Y7LJzZQSAiEAyIM/nh8qTxcoSNdhbmVtaWy/KMDjzFCVqCOhu9nvv9w=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/3xui-api-client@3.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":223713},"jest":{"testMatch":["**/test/**/*.js"],"testEnvironment":"node","coverageDirectory":"coverage","collectCoverageFrom":["index.js","src/**/*.js"]},"main":"index.js","type":"commonjs","types":"index.d.ts","engines":{"npm":">=9.0.0","node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","default":"./index.js","require":"./index.js"}},"funding":{"url":"https://github.com/sponsors/iamhelitha","type":"github"},"gitHead":"8d6e74424ea8b04198412bca700526f7e118a53e","scripts":{"lint":"eslint index.js src/","test":"echo \"No automated tests configured. Tests require a live panel environment.\"","test:jest":"jest","prepublishOnly":"echo 'Skipping tests for publishing'"},"_npmUser":{"name":"iamhelitha","email":"helithalochana@gmail.com"},"repository":{"url":"git+https://github.com/iamhelitha/3xui-api-client.git","type":"git"},"_npmVersion":"11.17.0","description":"Node.js API client for the 3x-ui panel (VLESS, VMess, Trojan, Shadowsocks, WireGuard, Reality) with automatic session management, credential generation, and full REST API coverage","directories":{},"_nodeVersion":"24.19.0","dependencies":{"axios":"^1.20.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^30.4.2","eslint":"^10.9.1","@eslint/js":"^10.0.1"},"_npmOperationalInternal":{"tmp":"tmp/3xui-api-client_3.2.0_1787760579757_0.8604831212328881","host":"s3://npm-registry-packages-npm-production"}},"3.2.1":{"name":"3xui-api-client","version":"3.2.1","description":"Node.js API client for the 3x-ui panel (VLESS, VMess, Trojan, Shadowsocks, WireGuard, Reality) with automatic session management, credential generation, and full REST API coverage","main":"index.js","types":"index.d.ts","exports":{".":{"types":"./index.d.ts","require":"./index.js","default":"./index.js"}},"scripts":{"test":"echo \"No automated tests configured. Tests require a live panel environment.\"","test:jest":"jest","lint":"eslint index.js src/","prepublishOnly":"echo 'Skipping tests for publishing'"},"keywords":["3x-ui","3xui","api","client","vpn","proxy","panel","xray","v2ray","server-management","api-client","network-management","credential-generation","session-management","web-integration","express-middleware","nextjs","vless","vmess","trojan","shadowsocks","wireguard","reality","3x-ui-client","3x-ui-api","xui-client","xui-api","xui","vpn-panel","vpn-api","vpn-client","rest-api-client","node","nodejs","typescript","sdk"],"author":{"name":"Helitha Guruge","email":"helithalochana@gmail.com","url":"https://github.com/iamhelitha"},"license":"Apache-2.0","type":"commonjs","repository":{"type":"git","url":"git+https://github.com/iamhelitha/3xui-api-client.git"},"bugs":{"url":"https://github.com/iamhelitha/3xui-api-client/issues"},"homepage":"https://github.com/iamhelitha/3xui-api-client#readme","funding":{"type":"github","url":"https://github.com/sponsors/iamhelitha"},"engines":{"node":">=18.0.0","npm":">=9.0.0"},"os":["linux","darwin","win32"],"dependencies":{"axios":"^1.20.0"},"devDependencies":{"jest":"^30.4.2","eslint":"^10.9.1","@eslint/js":"^10.0.1"},"jest":{"testEnvironment":"node","collectCoverageFrom":["index.js","src/**/*.js"],"coverageDirectory":"coverage","testMatch":["**/test/**/*.js"]},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"gitHead":"f9886975f0615286aaaec66a849d3a91c8bc81fc","_id":"3xui-api-client@3.2.1","_nodeVersion":"24.19.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-vk1z4Z9XtKGFYedIMu2sg183B8SEWhS/88fYjA6Q2J8ZdOdhGoh+/WovC0T8b5kqNVSr7gg5zKC3u8I2JOVSYA==","shasum":"fb6f9e9016969d14dfeea6b57e3e5793770101a7","tarball":"https://registry.npmjs.org/3xui-api-client/-/3xui-api-client-3.2.1.tgz","fileCount":12,"unpackedSize":226526,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/3xui-api-client@3.2.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQD6uTh3eLoea4g/ScpJCEnYVT/J5U7YF+IlLgj+bt0jVAIgJjLllbx7XdYUTxAGhKhtNFJjay1nGqQd9LyEUMoEQr0="}]},"_npmUser":{"name":"iamhelitha","email":"helithalochana@gmail.com"},"directories":{},"maintainers":[{"name":"iamhelitha","email":"helithalochana@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/3xui-api-client_3.2.1_1788093688673_0.10927460590631788"},"_hasShrinkwrap":false}},"time":{"created":"2025-06-19T22:00:51.263Z","modified":"2026-08-30T12:41:29.173Z","1.0.0":"2025-06-19T22:00:51.529Z","3.0.0":"2025-06-25T20:38:47.674Z","2.0.0":"2025-06-25T20:47:50.615Z","2.1.0":"2025-08-30T11:45:28.962Z","2.1.1":"2025-11-30T09:23:38.077Z","3.0.1":"2026-06-07T10:41:28.990Z","3.1.0":"2026-06-15T09:25:42.293Z","3.1.1":"2026-06-17T19:54:26.738Z","3.1.2":"2026-06-30T06:21:06.708Z","3.2.0":"2026-08-26T16:09:39.980Z","3.2.1":"2026-08-30T12:41:28.827Z"},"bugs":{"url":"https://github.com/iamhelitha/3xui-api-client/issues"},"author":{"name":"Helitha Guruge","email":"helithalochana@gmail.com","url":"https://github.com/iamhelitha"},"license":"Apache-2.0","homepage":"https://github.com/iamhelitha/3xui-api-client#readme","keywords":["3x-ui","3xui","api","client","vpn","proxy","panel","xray","v2ray","server-management","api-client","network-management","credential-generation","session-management","web-integration","express-middleware","nextjs","vless","vmess","trojan","shadowsocks","wireguard","reality","3x-ui-client","3x-ui-api","xui-client","xui-api","xui","vpn-panel","vpn-api","vpn-client","rest-api-client","node","nodejs","typescript","sdk"],"repository":{"type":"git","url":"git+https://github.com/iamhelitha/3xui-api-client.git"},"description":"Node.js API client for the 3x-ui panel (VLESS, VMess, Trojan, Shadowsocks, WireGuard, Reality) with automatic session management, credential generation, and full REST API coverage","maintainers":[{"name":"iamhelitha","email":"helithalochana@gmail.com"}],"readme":"<p align=\"center\">\n  <img src=\"assets/banner.png\" alt=\"3xui-api-client — the complete 3x-ui API client for Node.js\" width=\"100%\" />\n</p>\n\n# 3xui-api-client\n\nA Node.js / TypeScript API client for the **3x-ui panel** (Xray-core), with easy-to-use methods for managing inbounds and clients across **VLESS, VMess, Trojan, Shadowsocks, WireGuard,** and **Reality** protocols.\n\n[![npm version](https://badge.fury.io/js/3xui-api-client.svg)](https://badge.fury.io/js/3xui-api-client)\n[![npm downloads](https://img.shields.io/npm/dm/3xui-api-client.svg)](https://www.npmjs.com/package/3xui-api-client)\n[![GitHub stars](https://img.shields.io/github/stars/iamhelitha/3xui-api-client.svg)](https://github.com/iamhelitha/3xui-api-client)\n[![Node.js Version](https://img.shields.io/node/v/3xui-api-client.svg)](https://nodejs.org/)\n[![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/iamhelitha/3xui-api-client/graphs/commit-activity)\n[![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue.svg)](https://www.typescriptlang.org/)\n\n## 🚀 Context7 MCP Integration\n\nThis library is available through **[Context7 MCP](https://context7.com/iamhelitha/3xui-api-client)** for enhanced development experience with intelligent documentation integration. Use the package name `3xui-api-client` to get AI-powered context and documentation.\n\n---\n\n## Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n- [Quick Start](#quick-start)\n- [API Methods](#api-methods)\n- [Documentation](#documentation)\n- [Requirements](#requirements)\n- [Contributing](#contributing)\n- [Testing](#testing)\n- [FAQ](#faq)\n- [License](#license)\n\n## Features\n\n- ✅ **Dual Panel Support** - Works with both modern (React, v3.x+) and legacy (Vue, v2.x) 3x-ui panels\n- ✅ **Auto-Detection** - Automatically detects panel version and uses correct endpoints\n- ✅ **API Token Authentication** - Support for API token auth (3x-ui v3.0.2+) and cookie-based login\n- ✅ **Automatic Credential Generation** - Built-in UUID, password, and key pair generators\n- ✅ **Session Management** - Automatic login, session caching, and expiry handling\n- ✅ **Security** - Input validation, secure headers, rate limiting, and error sanitization\n- ✅ **Modern API Support** - Complete modern API (v3.x+) with advanced client management\n- ✅ **Legacy API Support** - Full backward compatibility with legacy API methods\n- ✅ **TypeScript Definitions** - Complete type definitions for IDE support\n- ✅ **124 API Methods** - Comprehensive coverage of all 3x-ui panel operations\n\n## Installation\n\n```bash\nnpm install 3xui-api-client\n```\n\n## Quick Start\n\n### Cookie-Based Authentication\n\n```javascript\nconst ThreeXUI = require('3xui-api-client');\n\nconst client = new ThreeXUI('https://your-3xui-server.com', 'username', 'password');\n\n// Get all inbounds\nconst inbounds = await client.getInbounds();\nconsole.log(inbounds);\n```\n\n### API Token Authentication (v3.0.2+)\n\n```javascript\nconst client = new ThreeXUI('https://your-3xui-server.com', {\n  token: 'your-api-token'\n});\n\nconst inbounds = await client.getInbounds();\n```\n\n### Panel Version Support\n\nThis library **automatically supports both modern and legacy 3x-ui panels**:\n\n```javascript\n// Automatic detection (recommended)\n// Works with both modern and legacy panels\nconst client = new ThreeXUI('https://your-3xui-server.com', 'username', 'password');\nawait client.login();\n// Automatically detects panel version and uses correct endpoints\n\n// Explicit version (optional, for performance)\nconst client = new ThreeXUI('https://your-3xui-server.com', 'username', 'password', {\n  panelType: 'modern'  // or 'legacy' or 'auto' (default)\n});\n```\n\n**Supported Panel Types:**\n- ✅ **Modern Panels** - React-based, v3.x+ with `/panel/api/*` endpoints\n- ✅ **Legacy Panels** - Vue-based, v2.x with `/login` endpoint\n- ✅ **Auto-Detection** - Tries modern first, falls back to legacy if needed\n- ✅ **Session Caching** - Detected version is cached for faster subsequent logins\n\nSee [PANEL-VERSION-SUPPORT.md](./PANEL-VERSION-SUPPORT.md) for detailed version support documentation.\n\n## API Methods\n\n### Client Management (Modern API - v3.x+)\n\n#### Read Operations\n- `getClients()` - Get all clients\n- `getPagedClients(params)` - Get paginated client list\n- `getClient(email)` - Get specific client by email\n- `getClientTraffic(email)` - Get client traffic statistics\n- `getSubLinks(subId)` - Get subscription links by subscription ID\n- `getClientLinks(email)` - Get generic client links\n- `getGroups()` - Get all client groups\n- `getGroupEmails(groupName)` - Get emails in specific group\n- `getOnlines()` - Get currently online clients\n- `getModernLastOnline()` - Get last online status\n- `getModernClientIps(email)` - Get client IP list\n\n#### Write Operations\n- `addModernClient(data)` - Add new client (modern API)\n- `updateModernClient(email, data)` - Update client details\n- `deleteModernClient(email)` - Delete client\n- `attachClientToInbounds(email, data)` - Attach client to inbounds\n- `detachClientFromInbounds(email, data)` - Detach client from inbounds\n- `resetModernClientTrafficByEmail(email)` - Reset client traffic\n- `updateModernClientTrafficByEmail(email, data)` - Update traffic limits\n- `clearModernClientIps(email)` - Clear client IP restrictions\n\n#### Bulk Operations\n- `bulkCreateModernClients(data)` - Bulk create clients\n- `bulkDeleteModernClients(data)` - Bulk delete clients\n- `bulkAttachModernClients(data)` - Bulk attach to inbounds\n- `bulkDetachModernClients(data)` - Bulk detach from inbounds\n- `bulkAdjustModernClients(data)` - Bulk adjust settings\n- `bulkResetTrafficModernClients(data)` - Bulk reset traffic\n- `resetAllModernClientTraffics()` - Reset all client traffic\n- `deleteDepletedModernClients()` - Delete depleted clients\n\n#### Group Management\n- `createGroup(data)` - Create client group\n- `renameGroup(data)` - Rename existing group\n- `deleteGroup(data)` - Delete group\n- `bulkAddGroups(data)` - Bulk add groups\n- `bulkRemoveGroups(data)` - Bulk remove groups\n\n### Client Management (Legacy API)\n\n- `addClient(clientConfig)` - Add client\n- `updateClient(clientId, clientConfig)` - Update client\n- `deleteClient(inboundId, clientId)` - Delete client\n- `deleteClientByEmail(inboundId, email)` - Delete by email\n- `getClientTrafficsByEmail(email)` - Get traffic by email\n- `getClientTrafficsById(id)` - Get traffic by ID\n- `getClientIps(email)` - Get client IPs\n- `clearClientIps(email)` - Clear IP restrictions\n- `updateClientTraffic(email, trafficConfig)` - Update traffic limits\n- `resetClientTraffic(inboundId, email)` - Reset traffic\n- `resetAllTraffics()` - Reset all traffic globally\n- `resetAllClientTraffics(inboundId)` - Reset inbound traffic\n- `deleteDepletedClients(inboundId)` - Delete depleted clients\n\n### Inbound Management\n\n- `getInbounds()` - Get all inbounds\n- `getInbound(id)` - Get specific inbound\n- `addInbound(inboundConfig)` - Add new inbound\n- `updateInbound(id, inboundConfig)` - Update inbound\n- `deleteInbound(id)` - Delete inbound\n- `importInbounds(inbounds)` - Bulk import inbounds\n- `getLastOnline()` - Get last online info\n\n### Node Management\n\n- `getNodes()` - Get all nodes\n- `getNode(id)` - Get specific node\n- `getNodeHistory(id, metric, bucket)` - Get node metrics history\n- `addNode(data)` - Add new node\n- `updateNode(id, data)` - Update node\n- `deleteNode(id)` - Delete node\n- `setNodeEnable(id)` - Enable node\n- `testNode(data)` - Test node connectivity\n- `probeNode(id)` - Probe node status\n\n### Custom Geo Management\n\n- `getCustomGeos()` - Get custom geo sites/IPs\n- `getGeoAliases()` - Get geo aliases\n- `addCustomGeo(data)` - Add custom geo\n- `updateCustomGeo(id, data)` - Update geo\n- `deleteCustomGeo(id)` - Delete geo\n- `downloadCustomGeo(id)` - Download geo data\n- `updateAllCustomGeo()` - Update all geo data\n\n### Server Management\n\n- `getServerStatus()` - Get CPU, RAM, uptime\n- `getCPUHistory(bucket)` - Get CPU usage history\n- `getXrayVersion()` - Get Xray version\n- `getConfigJson()` - Get Xray config JSON\n- `getDb()` - Download database\n- `stopXrayService()` - Stop Xray core\n- `restartXrayService()` - Restart Xray core\n- `installXray(version)` - Install specific Xray version\n- `getPanelLogs(count)` - Get panel logs\n- `getXrayLogs(count)` - Get Xray logs\n- `updateGeofile(fileName)` - Update GeoIP/GeoSite files\n- `importDB(formData)` - Import database\n\n### Panel Settings\n\n- `getAllSettings()` - Get all panel settings\n- `updateSetting(settings)` - Update settings\n- `updateUser(oldUsername, oldPassword, newUsername, newPassword)` - Change admin credentials\n- `restartPanel()` - Restart panel\n- `getDefaultSettings()` - Get default settings\n- `getDefaultJsonConfig()` - Get default Xray JSON config\n\n### Xray Configuration\n\n- `getXrayConfig()` - Get Xray configuration\n- `updateXrayConfig(config)` - Update Xray configuration\n- `manageWarp(action, data)` - Manage WARP settings\n- `testOutbound(outbound, options)` - Test connectivity through an outbound configuration\n- `getOutboundsTraffic()` - Get outbound traffic statistics\n- `resetOutboundsTraffic()` - Reset outbound traffic\n- `getXrayResult()` - Get Xray execution result\n\n### Server-Side Generators\n\n- `getNewUUID()` - Generate UUID server-side\n- `getNewX25519Cert()` - Generate X25519 certificate\n- `getNewmldsa65()` - Generate MLDSA65 key\n- `getNewmlkem768()` - Generate ML-KEM-768 key\n- `getNewVlessEnc()` - Generate VLESS encryption\n- `getNewEchCert()` - Generate ECH certificate\n\n### Credential Generation\n\n- `generateCredentials(protocol, options)` - Generate protocol-specific credentials\n- `generateUUID(secure)` - Generate UUID\n- `generatePassword(length, options)` - Generate password\n- `generateBulkCredentials(protocol, count, options)` - Bulk generate credentials\n- `generateWireGuardKeys()` - Generate WireGuard key pair\n- `generateRealityKeys()` - Generate Reality key pair\n- `generatePort(min, max)` - Generate random port\n- `getShadowsocksCiphers()` - List SS cipher methods\n- `getRecommendedShadowsocksCipher()` - Get recommended cipher\n- `validateCredentials(credentials, protocol)` - Validate credentials\n\n### Enhanced Client Management\n\n- `addClientWithCredentials(inboundId, protocol, options)` - Add client with auto-generated credentials\n- `updateClientWithCredentials(clientId, inboundId, options)` - Update client with credential management\n\n### Session Management\n\n- `login(forceRefresh)` - Authenticate with credentials/token\n- `logout()` - Clear session\n- `isSessionValid()` - Check session validity\n- `getSessionStats()` - Get session statistics\n- `clearAllSessions()` - Clear all cached sessions\n- `getTwoFactorEnable()` - Check 2FA status\n\n### System\n\n- `getOnlineClients()` - Get online clients\n- `createBackup()` - Create system backup\n- `backupToTgBot()` - Send backup to Telegram\n- `getSecurityStats()` - Get security monitoring data\n\n## Documentation\n\nFor comprehensive guides, examples, and implementation patterns, visit our **[Wiki](https://github.com/iamhelitha/3xui-api-client/wiki)**:\n\n- 📚 [Use Cases & Examples](https://github.com/iamhelitha/3xui-api-client/wiki/Use-Cases)\n- 🔐 [Authentication Guide](https://github.com/iamhelitha/3xui-api-client/wiki/Authentication-Guide)\n- 🌐 [Inbound Management](https://github.com/iamhelitha/3xui-api-client/wiki/Inbound-Management)\n- 👥 [Client Management](https://github.com/iamhelitha/3xui-api-client/wiki/Client-Management)\n- 📊 [Traffic Management](https://github.com/iamhelitha/3xui-api-client/wiki/Traffic-Management)\n- ⚙️ [System Operations](https://github.com/iamhelitha/3xui-api-client/wiki/System-Operations)\n- 🌐 [Modern API Guide](https://github.com/iamhelitha/3xui-api-client/wiki/Modern-API)\n\n## Requirements\n\n- Node.js >= 18.0.0\n- 3x-ui panel v2.0+ (or v3.0.2+ for API token authentication)\n- API access enabled on your 3x-ui server\n\n## Contributing\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'feat: add amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## Testing\n\n```bash\n# Run login test\nnpm run test:login\n\n# Run all tests\nnpm test\n```\n\n## FAQ\n\n**Q: Do I need to call `login()` explicitly?**\nA: No, the client automatically logs in before the first API call. Just create the client and start using it.\n\n**Q: Can I use API tokens instead of username/password?**\nA: Yes, use `{ token: 'your-api-token' }` instead of username/password (requires 3x-ui v3.0.2+).\n\n**Q: How do I store session cookies securely?**\nA: See the [Session Security](#session-security) section below and the [Authentication Guide](https://github.com/iamhelitha/3xui-api-client/wiki/Authentication-Guide) for server-side storage patterns.\n\n**Q: Which authentication method is more secure?**\nA: API tokens are recommended for production. See [Authentication Guide](https://github.com/iamhelitha/3xui-api-client/wiki/Authentication-Guide) for comparison.\n\n**Q: Can I use the client in browsers?**\nA: No, this is a Node.js library. Use it on your server side with proper CORS/security headers.\n\n**Q: How do I migrate from v2.x to v3.x?**\nA: The library is backward compatible. See [CHANGELOG.md](CHANGELOG.md) for breaking changes (if any).\n\n**Q: Can I bulk operations with this client?**\nA: Yes, use the `bulk*` methods for efficient batch operations. See [Client Management](https://github.com/iamhelitha/3xui-api-client/wiki/Client-Management) for examples.\n\n## Session Security\n\n> [!IMPORTANT]\n> The 3x-ui session cookie grants **full admin access** to your panel. Treat it with the same care as a password or API secret.\n\n### Cookie storage is unencrypted by default\n\nBoth built-in session stores save the cookie in plaintext:\n\n| Store | Where the cookie lives |\n|---|---|\n| `MemorySessionStore` (default) | Plain JS `Map` in process heap |\n| `DatabaseSessionStore` | `session_data TEXT` column, no encryption |\n| `RedisSessionStore` | Plain string value in Redis |\n\n**Recommendations:**\n- **Memory store** — safe for single-process, single-instance deployments. In shared/multi-tenant environments a heap dump exposes live admin cookies. Prefer Redis or DB stores with proper access controls.\n- **Database store** — restrict the DB user to only the sessions table with the minimum required privileges, and enable encryption-at-rest on the database itself.\n- **Redis store** — use Redis ACLs to restrict key-space access and enable TLS for the Redis connection.\n- For the highest security, use **API tokens** (`{ token: 'your-api-token' }`) instead of username/password — tokens can be scoped and revoked without a session cookie.\n\n### Session key is deterministic\n\nThe cache key is `sha256(baseURL:username)`. It is an intentionally stable lookup key, not a secret. Anyone with read access to the session store can correlate rows to specific panels and users. Protect the **values** (cookies), not the keys.\n\n### Serverless and multi-instance deployments\n\nEach serverless cold start (e.g. Vercel, AWS Lambda) creates a fresh in-memory session, triggering a `/login` call per instance. A few things to keep in mind:\n\n1. **Use a shared external store** (`RedisSessionStore` or `DatabaseSessionStore`) so instances can reuse existing sessions instead of re-authenticating every time.\n2. **Re-login backoff** — the client applies a configurable delay (default **500 ms**) before each forced re-login on a `401` response. This prevents a burst of cold starts from simultaneously hammering the panel login endpoint and tripping rate-limiting or fail2ban rules. You can tune it:\n\n```js\nconst client = new XuiApiClient({\n  baseURL: 'https://your-panel.example.com',\n  username: 'admin',\n  password: 'secret',\n  maxLoginRetries: 3,      // max 401-triggered re-login attempts (default: 3)\n  loginRetryBackoff: 1000, // ms to wait before each retry (default: 500, set 0 to disable)\n});\n```\n\n3. **Rate limit awareness** — `maxLoginRetries` is per-instance. Across many concurrent instances you can still exceed the panel's login-attempt limit. If your panel has fail2ban enabled, ensure your egress IP is whitelisted or use API token auth to avoid the login flow entirely.\n\n## License\n\nThis project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.\n\n## Support\n\n- 📖 [Wiki & Documentation](https://github.com/iamhelitha/3xui-api-client/wiki)\n- 🐛 [Report Issues](https://github.com/iamhelitha/3xui-api-client/issues)\n- 💬 [Discussions](https://github.com/iamhelitha/3xui-api-client/discussions)\n\n## Author\n\n**Helitha Guruge** - [@iamhelitha](https://github.com/iamhelitha)\n\n---\n\n⚠️ **Security Notice**: Always store credentials and session cookies securely. Never expose them in client-side code or commit them to version control.\n\n","readmeFilename":"README.md"}