@ikonai/sdk 0.0.10 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikonai/sdk",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
package/storage.d.ts ADDED
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Storage and token utilities.
3
+ */
4
+ /**
5
+ * Get or create a persistent device ID.
6
+ * Uses crypto.randomUUID() and stores in localStorage for persistence across sessions.
7
+ * Falls back to generating a new UUID if localStorage is unavailable.
8
+ */
9
+ export declare function getOrCreateDeviceId(): string;
10
+ /**
11
+ * Clear the device ID from localStorage.
12
+ * This is typically not needed unless you want to reset the anonymous user.
13
+ */
14
+ export declare function clearDeviceId(): void;
15
+ /**
16
+ * Extract the internal user ID from a JWT token.
17
+ * The token payload should contain an `id` field with the Ikon internal user ID.
18
+ * Returns null if the token cannot be decoded or doesn't contain an id.
19
+ */
20
+ export declare function extractUserIdFromToken(token: string): string | null;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Wait with abort support.
3
+ * @param ms - Milliseconds to wait
4
+ * @param signal - Optional abort signal to cancel the wait
5
+ * @returns Promise that resolves after ms or rejects if aborted
6
+ */
7
+ export declare function delay(ms: number, signal?: AbortSignal): Promise<void>;
package/utils/logger.d.ts CHANGED
@@ -62,8 +62,3 @@ export interface Logger {
62
62
  * ```
63
63
  */
64
64
  export declare function createLogger(component: string): Logger;
65
- /**
66
- * Default logger for backwards compatibility.
67
- * New code should use createLogger() with a component name.
68
- */
69
- export declare const logger: Logger;