// @ts-ignore - phenix-edge-auth doesn't have TypeScript definitions
import TokenBuilder from 'phenix-edge-auth';

export default class PhenixEdgeAuthService {
    private constructor() {
      throw new Error('PhenixEdgeAuthService is a static class that may not be instantiated');
    }
  
    public static createChannelToken({id, secret, channelId}: {id: string; secret: string; channelId: string}): string {
      return new TokenBuilder()
        .expiresIn(3600)
        .withUri('https://pcast-stg.phenixrts.com')
        .withApplicationId(id)
        .withSecret(secret)
        .forChannel(channelId)
        .build();
    }
  }