New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

screen-flow

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

screen-flow

Navigation intelligence library for React and React Native

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

screen-flow 🧭

Navigation intelligence, not just analytics. One-stop, platform-agnostic tracker for React and React Native.

license size tests

🚀 Why ScreenFlow?

In a world of bloated analytics SDKs (Segment, Firebase, Mixpanel), ScreenFlow is the minimalist's choice.

  • ⚡ Zero Bloat: Only a few KB. Won't slow down your app or increase your bundle size like 2MB+ commercial SDKs.
  • 🛡️ Privacy First: No data ever leaves the device unless you want it to. Total control over your user's privacy.
  • 📱 True Cross-Platform: Write once, track everywhere. Same API for Web and React Native with automatic lifecycle detection.
  • 🧠 More than Counters: Automatically tracks duration, maintains history, and detects back-navigation using smart algorithms.
  • 💾 Persistence Ready: Unlike other lightweight trackers, ScreenFlow can persist data across app restarts.
  • 🧪 100% Transparent: Open-source and fully covered by unit tests. No "black-box" tracking.

✨ Features

  • 🔄 Flow Tracking: Keeps track of the last 30 screens visited.
  • ⏱️ Time Awareness: Automatically tracks time spent on each screen.
  • 🔙 Smart Back Detection: Detects back navigation even across multiple screens.
  • ⏸️ Smart Pausing: Pauses timers when the app is in background.
  • ⚛️ React Ready: Comes with first-class hooks like useScreenFlow.
  • 🔌 Adapter Pattern: Send data to Console, Firestore, Segment, or your own API.

🚀 Installation

npm install screen-flow

⚙️ Quick Start

Setup your storage and output adapter.

import { initScreenFlow, ConsoleAdapter } from 'screen-flow';

initScreenFlow({
  adapter: new ConsoleAdapter(),
  // Persistence for Web (localStorage) or React Native (AsyncStorage)
  storage: localStorage, 
  sessionTimeout: 30 * 60 * 1000 // 30 mins
});

2. Track Screens

⚛️ Functional Components (React)

import { useScreenFlow } from 'screen-flow';

const Dashboard = () => {
  useScreenFlow('Dashboard', { tab: 'overview' });
  return <div>My Dashboard</div>;
};

🖱️ Manual Tracking

import { onScreenChange } from 'screen-flow';

// Anywhere in your logic
await onScreenChange('Settings');

🔌 Customizing Output (Adapters)

Connect ScreenFlow to any service in seconds.

import { Adapter, ScreenEvent } from 'screen-flow';

class MyBrandAdapter implements Adapter {
  onEvent(event: ScreenEvent) {
    console.log(`User stayed on ${event.previousScreen} for ${event.duration}ms`);
    // Send to your own server
    myApi.log(event);
  }
}

📄 Screen Event Data Structure

PropertyTypeDescription
screenstringCurrent screen name
previousScreenstring | nullName of the last screen
durationnumberTime spent on the last screen (ms)
flowstring[]Last 30 screens visited
isBackbooleanTrue if this move was a "Back" navigation
sessionIdstringUnique, persistent session ID
paramsobjectCustom metadata provided by you

💖 Support

If ScreenFlow saved you hours of work or helped you build a faster app, consider supporting the development!

Buy Me A Coffee

🛡️ License

ISC (Free and Open Source)

Keywords

react

FAQs

Package last updated on 23 Dec 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts