keycrate
v1.0.0
Published
License authentication SDK for Keycrate
Readme
Keycrate JavaScript SDK
License authentication SDK for JavaScript/TypeScript projects.
Installation
npm install keycrateUsage
Authenticate with License Key
import { configurate } from "keycrate-js";
const client = configurate("https://api.example.com", "your-app-id");
const result = await client.authenticate({
license: "your-license-key",
});
if (result.success) {
console.log("License verified!");
} else {
console.log("Error:", result.message);
}Authenticate with Username/Password
const result = await client.authenticate({
username: "[email protected]",
password: "password123",
});Authenticate with HWID (Hardware ID)
const result = await client.authenticate({
license: "your-license-key",
hwid: "device-id-12345",
});Register Credentials
const result = await client.register({
license: "your-license-key",
username: "[email protected]",
password: "securepassword",
});API Reference
configurate(host, appId)
Creates and returns a client instance.
Parameters:
host(string): Base URL of the Keycrate APIappId(string): Your application ID
Returns: LicenseAuthClient instance
client.authenticate(options)
Authenticate using either a license key or username/password.
Parameters:
options.license(string, optional): License keyoptions.username(string, optional): Usernameoptions.password(string, optional): Passwordoptions.hwid(string, optional): Hardware ID
Returns: Promise<{success: boolean, message: string, data?: object}>
client.register(options)
Register credentials for a license.
Parameters:
options.license(string, required): License keyoptions.username(string, required): Usernameoptions.password(string, required): Password
Returns: Promise<{success: boolean, message: string}>
License
MIT
