Installation
The official Loyalty.lt JavaScript SDK is available on npm and can be used in Node.js, React, Vue, and any JavaScript environment.NPM / Yarn
CDN (Browser)
For browser-based applications without a build system:Requirements
Node.js
Node.js 16.0.0 or higher
TypeScript
TypeScript 4.0+ (optional, types included)
For React Components
If you plan to use the React components (QRLogin, QRCardDisplay), you also need:
Quick Start
Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
apiKey | string | - | Your API Key (required) |
apiSecret | string | - | Your API Secret (required) |
environment | 'production' | 'staging' | 'production' | API environment |
locale | string | 'lt' | API locale (lt, en) |
timeout | number | 30000 | Request timeout in ms |
debug | boolean | false | Enable debug logging |
retries | number | 3 | Number of retry attempts |
Getting API Credentials
1
Access Partners Portal
Go to partners.loyalty.lt and log in to your account.
2
Navigate to API Credentials
Click API Credentials in the sidebar.
3
Generate Credentials
Click Generate New Credentials to create your API Key and Secret.
4
Copy Credentials
Copy both the API Key (
lty_...) and API Secret. Store them securely!