Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

593 B
Raw Blame
const NOTIFICATION_CHANNEL_API_PATH = '/api/notification-channel'

const joinClientUrl = (clientUrl: string, path: string) =>
  `${clientUrl.replace(/\/$/, '')}${path}`

export const buildNotificationChannelVerifyUrl = (
  clientUrl: string,
  token: string,
) =>
  joinClientUrl(
    clientUrl,
    `${NOTIFICATION_CHANNEL_API_PATH}/verify/${encodeURIComponent(token)}`,
  )

export const buildNotificationChannelUnsubscribeUrl = (
  clientUrl: string,
  token: string,
) =>
  joinClientUrl(
    clientUrl,
    `${NOTIFICATION_CHANNEL_API_PATH}/unsubscribe/${encodeURIComponent(token)}`,
  )