yakura-sdk
v1.0.4
Published
SDK for Yakura platform integration
Downloads
6
Readme
Yakura SDK
The Yakura SDK is a TypeScript library that provides seamless integration with the Yakura platform for software access verification and device fingerprinting.
Features
- Device fingerprinting using FingerprintJS
- Software access verification
- Cross-platform support (Node.js and Browser environments)
- TypeScript support with type definitions
- UUID validation for software access IDs
- Email validation
Installation
npm install yakura-sdkUsage
Basic Setup
import { YakuraSDK } from 'yakura-sdk';
const sdk = new YakuraSDK({
softwareAccessId: 'your-software-access-uuid',
userEmail: '[email protected]'
});Verifying Access
// Verify if the user has access to the software
const access = await sdk.verifyAccess();
if (access.valid) {
console.log('Access granted!');
console.log('Subscription type:', access.subscriptionType);
console.log('Expires at:', access.expiresAt);
} else {
console.log('Access denied:', access.purchaseStatus);
}API Reference
YakuraSDK
Constructor
new YakuraSDK(config: YakuraSDKConfig)Configuration Options:
softwareAccessId: string (UUID) - The unique identifier for your softwareuserEmail: string - The email address of the user
Methods
verifyAccess()
Verifies if the user has access to the software.
async verifyAccess(): Promise<TokenValidationResponse>Returns:
{
valid: boolean;
expiresAt?: Date;
subscriptionType?: string;
purchaseStatus?: string;
}getSoftwareAccessId()
Returns the software access ID.
getSoftwareAccessId(): stringgetUserEmail()
Returns the user email.
getUserEmail(): stringError Handling
The SDK includes built-in validation for:
- UUID format of softwareAccessId
- Email format of userEmail
- Device fingerprinting errors
