@100mslive/hms-video-store
Version:
@100mslive Core SDK which abstracts the complexities of webRTC while providing a reactive store for data management with a unidirectional data flow
16 lines (14 loc) • 351 B
text/typescript
import { v4 as uuid } from 'uuid';
import { LocalStorage } from './local-storage';
export const getAnalyticsDeviceId = () => {
let id;
const storage = new LocalStorage<string>('hms-analytics-deviceId');
const storageId = storage.get();
if (storageId) {
id = storageId;
} else {
id = uuid();
storage.set(id);
}
return id;
};