open-index/open-npm huggingface dataset:
npm package: @hajiracm/tracking-core
Description: Core types + API client for Hajira tracking
Latest version: 0.1.0

# @hajiracm/tracking-core

Core (platform-agnostic) building blocks for the Hajira **shift breadcrumb tracking** system:

- Shared types (`TrackingPoint`, `TrackingShiftSummary`, etc.)
- A small `fetch`-based API client (`createTrackingFetchClient`)
- Helper to read default env config (`getDefaultTrackingEnvConfig`)

## Install

```bash
npm i @hajiracm/tracking-core
```

## Usage (Next.js / Node 18+ / Expo)

```ts
import { createTrackingFetchClient } from "@hajiracm/tracking-core";

const api = createTrackingFetchClient({
  baseUrl: process.env.BE_HOST!,
  apiKey: process.env.API_KEY,
});

const res = await api.listShifts({ employeeId: "123", limit: 50 });
```

## Environment helper

`getDefaultTrackingEnvConfig()` searches (in order):

- `TRACKING_API_BASE_URL`, `EXPO_PUBLIC_API_BASE_URL`, `BE_HOST`, `NEXT_PUBLIC_BE_HOST`
- `TRACKING_API_KEY`, `EXPO_PUBLIC_API_KEY`, `API_KEY`
npm package: @hajiracm/tracking-expo
Description: Expo/React Native implementation of Hajira continuous tracking
Latest version: 0.1.0

# @hajiracm/tracking-expo

Expo/React Native implementation of Hajira **continuous shift tracking**.

What you get:
- Shift lifecycle: `startShiftTracking`, `pauseShiftTracking`, `resumeShiftTracking`, `stopShiftTracking`
- Background collection (Dev Build / Production) via `expo-task-manager` + `expo-location`
- Expo Go fallback (Android): foreground `watchPositionAsync` while app is open
- Offline queue in `expo-sqlite` + batch upload
- Built-in `AsyncStorage` log buffer (`@hajiracm/tracking-expo/logcat`)

## Install

```bash
npm i @hajiracm/tracking-expo
```

## Required peer deps (your app must already have these)

- `expo-location`, `expo-task-manager`, `expo-sqlite`, `expo-constants`
- `@react-native-async-storage/async-storage`
- `@react-native-community/netinfo`

## Setup (Expo app)

1) Import the task once at startup (side-effect import):

```ts
import "@hajiracm/tracking-expo/trackingTask";
```

2) Ensure Android permissions are declared in your `app.json` / config:

- `ACCESS_COARSE_LOCATION`, `ACCESS_FINE_LOCATION`
- `ACCESS_BACKGROUND_LOCATION` (recommended for locked-screen tracking)
- `FOREGROUND_SERVICE`, `FOREGROUND_SERVICE_LOCATION`
- `POST_NOTIFICATIONS` (Android 13+)

3) Configure API env (default client):

- `EXPO_PUBLIC_API_BASE_URL`
- `EXPO_PUBLIC_API_KEY` (optional if your backend doesn’t require it)

Or inject your own client:

```ts
import { configureTrackingApiClient } from "@hajiracm/tracking-expo";
// configureTrackingApiClient(myClient)
```

## Usage

```ts
import { startShiftTracking, stopShiftTracking } from "@hajiracm/tracking-expo";

await startShiftTracking({ employeeId: "E1", workspaceId: "W1" });
// ... later
await stopShiftTracking();
```

## Logcat (in-app logs)

```ts
import { logI } from "@hajiracm/tracking-expo/logcat";
logI("TRACKING", "hello");
```
npm package: @hajiracm/tracking-init
Description: Expo/React Native tracking initiator (permissions + device id + foreground/background services) with an AsyncStorage queue (no SQLite)
Latest version: 0.1.0

# @hajiracm/tracking-init

Small Expo/React Native helper package that **initiates tracking**:

- Checks/creates a `deviceId`
- Requests required runtime permissions
- Starts background tracking via `expo-task-manager` + `expo-location` (**Android foreground service notification included**)
- Falls back to foreground `watchPositionAsync` on Expo Go (Android)
- Queues points to `AsyncStorage` (**no SQLite / no DB**)

This package does **not** upload to your backend. Your app can read/drain the queue and upload however you want.

## Install

```bash
npm i @hajiracm/tracking-init @hajiracm/tracking-core
```

Peer deps (install in your app):

```bash
npx expo install expo-location expo-task-manager expo-constants
npx expo install @react-native-async-storage/async-storage @react-native-community/netinfo
```

## Setup (required)

Import the task once at app startup (side-effect import):

```ts
import "@hajiracm/tracking-init/trackingTask";
```

## Usage

```ts
import { startTracking, stopTracking, drainQueuedTrackingPoints } from "@hajiracm/tracking-init";

await startTracking({ sessionId: "shift_123" });

// ... later (e.g. when online)
const points = await drainQueuedTrackingPoints({ sessionId: "shift_123", limit: 200 });
// upload points yourself...

await stopTracking();
```