feat!: @rudder/sdk 0.1.0: createClient, idempotent modules.call retries, storage save(type, data), drop resources and projectStorage

This commit is contained in:
edmand46
2026-09-17 15:26:42 +03:00
parent c25b1c2c61
commit 1e4e0d928d
35 changed files with 474 additions and 467 deletions
+4 -3
View File
@@ -1,10 +1,11 @@
/**
* Device ID provider — generates and persists a unique device identifier.
*
* Uses `crypto.randomUUID()` (available in all evergreen browsers) and
* stores the generated UUID in localStorage under `rudder_device_id`.
* Generates a UUID v4 and stores the generated UUID in localStorage under `rudder_device_id`.
*/
import { uuidv4 } from '../core/uuid.js';
const STORAGE_KEY = 'rudder_device_id';
/**
@@ -19,7 +20,7 @@ export function getOrCreateDeviceId(): string {
// localStorage unavailable — generate ephemeral ID.
}
const id = crypto.randomUUID();
const id = uuidv4();
try {
localStorage.setItem(STORAGE_KEY, id);
} catch {