Catalog npm
PACKAGE EXPLORERView in registry

3x-ui-panel-client

npm

## init client

Versions collected1
Direct dependencies3From release 0.1.1
Last observed20 Oct, 19:54 UTC

README

Current package documentation

3X-UI client

init client

(async () => {
  const panelClient = new Client({
    username: process.env.PANEL_USER,
    password: process.env.PANEL_PASSWORD,
    host: process.env.PANEL_HOST,
    port: process.env.PANEL_PORT,
    scheme: process.env.PANEL_SCHEME, // http/https
  });

  // call login once before other calls
  await panelClient.login();
})();

list clients

const inbounds = await panelClient.getInbounds();
// find vless inbound
const inbound = inbounds.find((inbound) => inbound.protocol === "vless");
console.log(inbound.id);
const { clientStats, settings } = inbound;
clientStats.forEach((clientStat) =>
  console.log(
    clientStat.id,
    clientStat.enable,
    clientStat.email,
    (clientStat.up + clientStat.down) / 1024 / 1024 / 1024
  )
);
const settingsObj = JSON.parse(settings);
console.log(settingsObj.clients);

create clients

const inboundId = 1;

await panelClient.addClient({
  inboundId,
  email: "test1",
  totalGB: 0, // no traffic limit
});
await panelClient.addClient({
  inboundId,
  email: "test2",
  totalGB: 107374182400, // 100Gb traffic limit
});

delete client

const client = settingsObj.clients.find((client) => client.email === "test1");
await panelClient.delClient({ inboundId, clientId: client.id });

update client (enable, disable, update totalGB)

const client = settingsObj.clients.find((client) => client.email === "test1");
await panelClient.updateClient({
  inboundId,
  clientSettings: {
    ...client,
    enable: false,
    // totalGB: 0,
  },
});

reset client traffic

const client = settingsObj.clients.find((client) => client.email === "test1");
await panelClient.resetClientTraffic({ inboundId, email: client.email });

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.1.1Registry latest24 Aug 20243

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:54 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:e7b655532906b4e534f8ce61e94c8963669dea1cb40e3bfd7853483c4b5b86b4