Official JavaScript SDK and console example for AuthlyX V3 (3.0.0 beta). It runs on Node.js.
Full documentation: https://docs.authlyx.dev
- Windows
- Node.js 22 or newer
There is nothing to install. The SDK only uses what ships with Node.js.
Put your app key and version in main.js:
const app = new AuthlyX("YOUR_APP_KEY", "1.0.0");Then run it:
npm startYou can find your app key under your app's credentials in the dashboard.
Copy AuthlyX.js into your project:
import { AuthlyX } from "./AuthlyX.js";
const app = new AuthlyX("YOUR_APP_KEY", "1.0.0");
const connected = await app.initialize();
console.log(connected.ok ? "Connected" : connected.message);Every method returns a promise. You can also pass a callback as the last argument instead.
await app.login("YOUR_USERNAME", "YOUR_PASSWORD");
await app.login("YOUR_LICENSE_KEY");
await app.deviceLogin();Device login signs in the current Windows user without a form. The device has to be approved in your app first. See Device login.
After signing in, the account details are in userData:
const username = app.userData.Username;
const plan = app.userData.Plan;
const expiry = app.userData.ExpiryDate;Every method has its own page with examples under SDK methods.
Once someone is signed in, saving offline access stores a signed permit on that PC:
const saved = await app.saveOfflineAccess();
const available = await app.hasOfflineAccess();If they open your app later without internet, they sign in with the same username and password or license key, and the SDK checks it against the saved permit. Each permit belongs to one app and one account, and signing out removes it. More in Offline access.
A failed call gives you a code and a message you can show to the user. Network problems and some setup errors throw AuthlyXError instead, so wrap initialize() in try like the example does. All codes are listed in Errors.
V3 is a new SDK, not a drop-in update. Apps use an app key instead of the old owner ID, app name and secret, and the method names changed. Read Move from V2 to V3 before you switch.
MIT. See LICENSE.txt.