```typescript
import { useEffect } from 'react';
import Pusher from 'pusher-js';
import { useToast } from '@/hooks/use-toast';

interface NotificationData {
  title: string;
  message: string;
  type?: 'info' | 'success' | 'warning' | 'error' | 'news';
  url?: string;
  sessionId?: number;
  isLiveStream?: boolean;
  timestamp: string;
  newsId?: number;
}

export function useNotifications(userId?: number) {
  const { toast } = useToast();

  useEffect(() => {
    // Initialize Pusher
    const pusher = new Pusher(process.env.VITE_PUSHER_KEY!, {
      cluster: process.env.VITE_PUSHER_CLUSTER!,
    });

    // Subscribe to notifications channel
    // If userId is provided, subscribe to user-specific channel
    const channelName = userId ? `notifications-user-${userId}` : 'notifications';
    const channel = pusher.subscribe(channelName);

    // Handle generic notifications
    channel.bind('notification', (data: NotificationData) => {
      console.log('Received notification:', data);
      
      toast({
        title: data.title,
        description: data.message,
        variant: data.type === 'error' ? 'destructive' : 'default',
      });

      // You can handle different notification types here
      if (data.isLiveStream) {
        // Handle live stream notification
        console.log('Live stream notification:', data);
      }

      if (data.sessionId) {
        // Handle session-related notification
        console.log('Session notification:', data);
      }
    });

    // Handle news notifications
    channel.bind('news', (data: NotificationData) => {
      console.log('Received news notification:', data);
      
      toast({
        title: data.title,
        description: data.message,
        variant: 'default',
      });

      if (data.newsId) {
        // Handle news-specific actions
        console.log('News notification:', data);
      }
    });

    return () => {
      // Cleanup
      channel.unbind_all();
      channel.unsubscribe();
    };
  }, [userId]);
}

// Example usage in a component:
/*
function YourComponent() {
  const { user } = useAuth();
  
  // Pass user ID to get user-specific notifications
  useNotifications(user?.id);

  return (
    // Your component JSX
  );
}
*/
```
