subgang-sdk
v1.0.4
Published
Subgang SDK for logging install and session data in React Native apps.
Downloads
350
Readme
Subgang SDK
Subgang SDK is a lightweight library for React Native applications that helps track install and session data.
Installation
Features
- Log session data including device information and app details
- Track install events
- Associate user IDs with sessions
- Retrieve device ID
Usage
Initializing the SDK
import SessionLogger from 'subgang-sdk';
const logger = await SessionLogger.init('your-api-key');
You can also initialize with a user ID:
const logger = await SessionLogger.init('your-api-key', 'user-id');
Setting User ID
await logger.setUserId('user123');
Getting Device ID
const deviceId = await logger.getDeviceId();
console.log('Device ID:', deviceId);
How it works
- On initialization, the SDK logs a session, including whether it's a new install.
- Device information is automatically collected and sent with each session log.
- User IDs can be associated with sessions for user-specific tracking.
Note
Ensure you have the necessary permissions and comply with privacy regulations when using this SDK to collect and transmit user and device data.
Support
For issues and feature requests, please open an issue on our GitHub repository.