import { Injectable, InjectionToken, inject } from 'injection-js'; export type PlatformId = 'browser' | 'server'; export const PLATFORM_ID = new InjectionToken('PLATFORM_ID'); @Injectable() export class PlatformProvider { private readonly platformId = inject(PLATFORM_ID); isBrowser(): boolean { return this.platformId === 'browser'; } }