# FocusFlick SDK

Track user attention like never before.  
FocusFlick is a lightweight, privacy-first JavaScript SDK for capturing **focus**, **blur**, **mouse activity**, and **session analytics** in real-time.

---

## 🚀 Installation

```bash
npm install focusflick
```

---

## 🧠 Basic Usage

```js
import FocusFlick from 'focusflick';

const flick = new FocusFlick({
  siteOwnerId: 'ff_yourID123',  // Required
  enableClicks: true,           // Track click events
  enableMousemove: true,        // Track mouse movement
  enableFocus: true             // Track tab focus/blur
});

flick.init();
```

You can retrieve the collected session data any time:

```js
console.log(flick.getSessionData());
```

---

## 📦 Features

- Tracks `click`, `mousemove`, `focus`, `blur`, `session_start`, `session_end`
- Stores session data in `localStorage`
- Easily extendable for sending to APIs (e.g. Supabase, NocoDB, Render)
- Fully installable via npm or available as a standalone browser script

---

## 🖥️ CDN (for non-devs)

Don't want to install via npm?

Just use the browser version:

```html
<script src="https://www.focusflick.xyz/focusflick.min.js"></script>
<script>
  const flick = new FocusFlick({ siteOwnerId: 'ff_yourID123' });
  flick.init();
</script>
```

---

## 🔐 Privacy First

FocusFlick does **not** fingerprint or collect personal data.  
All sessions are scoped to your own site domain, and you choose how data is handled (local vs. cloud).

---

## 🛠️ Support

Need help?  
Email us at [support@focusflick.xyz](mailto:support@focusflick.xyz)

---

## 🔗 Links

- 🌐 [Website](https://www.focusflick.xyz)
- 📦 [NPM Package](https://www.npmjs.com/package/focusflick)
- 🧪 [Demo](https://www.focusflick.xyz/demo.html)

---

## 🪪 License

MIT License — free for personal and commercial use.
