Skip to content

Client initialization options ​

Login helpers take a separate login argument and an InitOptions object. Every login flow requires a device value.

ts
import { loginWithQR } from "@nezumi0627/vylinejs";
import { FileStorage } from "@nezumi0627/vylinejs/storage";

const client = await loginWithQR({
	onReceiveQRUrl(url) {
		console.log(url);
	},
	onPincodeRequest(pin) {
		console.log("Enter this PIN in LINE:", pin);
	},
}, {
	device: "IOSIPAD",
	storage: new FileStorage("./private/line-session.json"),
	// endpoint: "legy.line-apps.com",
	// version: "26.6.2",
	// fetch: (input, init) => fetch(input, init),
	// legy: { encrypted: "auto" },
});

Options ​

OptionTypeDefaultPurpose
deviceDeviceRequiredProtocol device profile, such as IOSIPAD, ANDROID, or DESKTOPWIN.
versionstringDevice-specificLINE application version sent in protocol identification fields. Override only when you know which profile the server expects.
endpointstringlegy.line-apps.comAPI endpoint used by the client. Most users should keep the default.
storageBaseStorageMemoryStoragePersists credentials, E2EE material, and protocol state. Use protected persistent storage for a long-running client.
fetchFetchLikeglobalThis.fetchCustom network function for environments that need a proxy or custom transport.
legy.encryptedboolean | "auto""auto"Controls LEGY request encryption. auto selects behavior based on the credential/token type.
legy.endpointstringLibrary defaultOverrides the LEGY endpoint when using a custom compatible server.

Supported device strings are DESKTOPWIN, DESKTOPMAC, ANDROID, ANDROIDSECONDARY, IOS, IOSIPAD, WATCHOS, and WEAROS. LINE may reject a device/version combination; these values imitate protocol profiles and do not identify the host operating system.

MemoryStorage is cleared when the process exits. FileStorage writes JSON in plaintext, so restrict access to the file. For encrypted persistence, use EncryptedStorage with a non-exportable AES-GCM key held outside this library; see authentication and session storage.

The exact public option type is exported as InitOptions from the main package. See the authentication guide for the separate arguments accepted by each login helper.

Vylinejs is an unofficial LINE client library. Released under the MIT License.