Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/openstatusHQ/openstatus. ๐ซ Status page with uptime monitoring & API monitoring as code ๐ซ openstatus.dev
bun drizzle-orm monitoring monitoring-as-code nextjs observability on-call open-source shadcn-ui status-page statuspage synthetic-monitoring tinybird turso uptime uptime-checker uptime-monitor
Something went wrong. Try again.
1.1 kB ยท 42 lines
TypeScript
12345678910111213141516171819202122232425262728293031323334353637383940414243import type { SubscriptionChannel } from "../types";import { sendEmailNotifications, sendEmailVerification, validateEmailConfig,} from "./email";import { sendSlackNotifications, validateSlackConfig } from "./slack";import { sendWebhookNotifications, sendWebhookVerification, validateWebhookConfig,} from "./webhook";
export function getChannel(channelType: string): SubscriptionChannel | null { switch (channelType) { case "email": { return { id: "email", sendNotifications: sendEmailNotifications, sendVerification: sendEmailVerification, validateConfig: validateEmailConfig, }; } case "webhook": { return { id: "webhook", sendNotifications: sendWebhookNotifications, sendVerification: sendWebhookVerification, validateConfig: validateWebhookConfig, }; } case "slack": { return { id: "slack", sendNotifications: sendSlackNotifications, validateConfig: validateSlackConfig, }; } default: return null; }}