npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-unvired-sdk

v1.0.13

Published

Unvired SDK for React Native with logging, database, notifications, and file system support

Readme

React Native Unvired SDK

A comprehensive SDK for React Native applications with support for logging, database operations, notifications, and file system management.

Installation

npm install react-native-unvired-sdk
# or
yarn add react-native-unvired-sdk

Optional Dependencies

The logger works out of the box with zero dependencies. For additional features, install the packages you need:

# For file operations
npm install react-native-fs

# For database (choose one)
npm install react-native-sqlite-storage  # SQL database
npm install @react-native-async-storage/async-storage  # Simple key-value

# For notifications
npm install @notifee/react-native

See NPM_PACKAGES.md for detailed package information and implementation guide.

Features

  • 📝 Logger - Comprehensive logging with multiple log levels ✅ No dependencies
  • 💾 Database - Database operations and data persistence ⚠️ Requires optional package
  • 🔔 Notifications - Push and local notification management ⚠️ Requires optional package
  • 📁 File System - File read/write and management operations ⚠️ Requires optional package
  • 🔌 PlatformInterface - Compatible with PlatformInterface pattern for cross-platform logging

Usage

Basic Initialization

import UnviredSDK, { LogLevel } from 'react-native-unvired-sdk';

// Initialize the SDK with all modules
await UnviredSDK.initialize({
  logLevel: LogLevel.DEBUG,
  tag: 'MyApp',
  database: {
    // Database configuration
  },
  notifications: {
    // Notification configuration
  },
  fileSystem: {
    basePath: '/path/to/files'
  }
});

Using the Logger

import { logger, LogLevel } from 'react-native-unvired-sdk';

// Set log level
logger.setLogLevel(LogLevel.DEBUG);

// Log messages
logger.debug('Debug message');
logger.info('Info message');
logger.warn('Warning message');
logger.error('Error message');

// Create child logger for specific modules
const childLogger = logger.createChild('FeatureModule');
childLogger.info('This is from a child logger');

Using PlatformInterface Pattern

import { logger } from 'react-native-unvired-sdk';

// Use with className and methodName (PlatformInterface compatible)
logger.logInfo('UserService', 'login', 'User login attempt');
logger.logError('UserService', 'login', 'Login failed');
logger.logDebug('UserService', 'fetchProfile', 'Fetching user profile');

// Set log level (accepts string)
logger.setLogLevel('DEBUG');

// File-based logging
const logs = await logger.getLogFileContent();
const backupLogs = await logger.getBackupLogFileContent();
await logger.clearLogFile();

Database Operations

import { database } from 'react-native-unvired-sdk';

// Initialize database (if not done in SDK initialization)
await database.initialize({ /* config */ });

// Insert or update data
await database.upsert('users', {
  id: 1,
  name: 'John Doe',
  email: '[email protected]'
});

// Query data
const users = await database.query('users', { 
  where: { active: true } 
});

// Delete data
await database.delete('users', { id: 1 });

// Execute transaction
await database.transaction(async (db) => {
  await db.upsert('users', userData);
  await db.upsert('profiles', profileData);
});

// Clear all data
await database.clear();

// Close database
await database.close();

Notifications

import { notificationManager } from 'react-native-unvired-sdk';

// Initialize notifications (if not done in SDK initialization)
await notificationManager.initialize({ /* config */ });

// Request permissions
const granted = await notificationManager.requestPermissions();

// Show a notification
await notificationManager.showNotification({
  title: 'Hello',
  body: 'This is a notification',
  data: { customData: 'value' }
});

// Schedule a notification
const notificationId = await notificationManager.scheduleNotification(
  {
    title: 'Reminder',
    body: 'Don\'t forget!'
  },
  new Date(Date.now() + 3600000) // 1 hour from now
);

// Cancel a notification
await notificationManager.cancelNotification(notificationId);

// Listen for notification events
const unsubscribe = notificationManager.on('onNotificationReceived', (notification) => {
  console.log('Notification received:', notification);
});

// Set badge count
await notificationManager.setBadgeCount(5);

// Get badge count
const count = await notificationManager.getBadgeCount();

File System Operations

import { fileManager } from 'react-native-unvired-sdk';

// Initialize file manager (if not done in SDK initialization)
await fileManager.initialize({ basePath: '/path/to/files' });

// Read a file
const content = await fileManager.readFile('data.txt');

// Write to a file
await fileManager.writeFile('data.txt', 'Hello World');

// Append to a file
await fileManager.appendFile('log.txt', 'New log entry\n');

// Check if file exists
const exists = await fileManager.exists('data.txt');

// Delete a file
await fileManager.deleteFile('old-file.txt');

// Create directory
await fileManager.createDirectory('my-folder');

// List files in directory
const files = await fileManager.listFiles('my-folder');

// Copy file
await fileManager.copyFile('source.txt', 'destination.txt');

// Move file
await fileManager.moveFile('old-location.txt', 'new-location.txt');

// Download file
await fileManager.downloadFile(
  'https://example.com/file.pdf',
  'downloads/file.pdf',
  (progress) => console.log(`Downloaded: ${progress}%`)
);

// Upload file
await fileManager.uploadFile(
  'local-file.jpg',
  'https://example.com/upload',
  { headers: { 'Authorization': 'Bearer token' } },
  (progress) => console.log(`Uploaded: ${progress}%`)
);

// Get file info
const info = await fileManager.getFileInfo('data.txt');
console.log(info.size, info.modifiedTime);

SDK Shutdown

// Properly shutdown SDK and cleanup resources
await UnviredSDK.shutdown();

API Reference

Log Levels

  • LogLevel.DEBUG - Detailed debugging information
  • LogLevel.INFO - General informational messages
  • LogLevel.WARN - Warning messages
  • LogLevel.ERROR - Error messages
  • LogLevel.NONE - Disable all logging

Logger Methods

  • logger.debug(message, ...args) - Log debug message
  • logger.info(message, ...args) - Log info message
  • logger.warn(message, ...args) - Log warning message
  • logger.error(message, ...args) - Log error message
  • logger.setLogLevel(level) - Set minimum log level
  • logger.setTag(tag) - Set custom tag
  • logger.createChild(childTag) - Create child logger with custom tag

Database Methods

  • database.initialize(config) - Initialize database
  • database.upsert(table, data) - Insert or update data
  • database.query(table, query) - Query data
  • database.delete(table, query) - Delete data
  • database.transaction(callback) - Execute transaction
  • database.clear() - Clear all data
  • database.close() - Close database connection

Notification Methods

  • notificationManager.initialize(config) - Initialize notifications
  • notificationManager.requestPermissions() - Request notification permissions
  • notificationManager.showNotification(notification) - Show notification
  • notificationManager.scheduleNotification(notification, time) - Schedule notification
  • notificationManager.cancelNotification(id) - Cancel notification
  • notificationManager.cancelAllNotifications() - Cancel all notifications
  • notificationManager.on(event, handler) - Register event handler
  • notificationManager.setBadgeCount(count) - Set badge count
  • notificationManager.getBadgeCount() - Get badge count

File System Methods

  • fileManager.initialize(config) - Initialize file manager
  • fileManager.readFile(path, encoding) - Read file
  • fileManager.writeFile(path, content, encoding) - Write file
  • fileManager.appendFile(path, content, encoding) - Append to file
  • fileManager.deleteFile(path) - Delete file
  • fileManager.exists(path) - Check if file exists
  • fileManager.createDirectory(path) - Create directory
  • fileManager.listFiles(path) - List files in directory
  • fileManager.copyFile(source, dest) - Copy file
  • fileManager.moveFile(source, dest) - Move file
  • fileManager.downloadFile(url, path, onProgress) - Download file
  • fileManager.uploadFile(path, url, options, onProgress) - Upload file
  • fileManager.getFileInfo(path) - Get file information

Development

# Install dependencies
npm install

# Run tests
npm test

# Lint code
npm run lint

# Format code
npm run format

Architecture

The SDK is organized into modular components:

src/
├── logger/          # Logging utilities
├── database/        # Database operations
├── notifications/   # Notification management
├── fileSystem/      # File system operations
└── index.js         # Main SDK entry point

Each module can be initialized independently or as part of the main SDK initialization.

License

MIT