faviconUrl (lib/integration-icons.ts)

second · apps/web/src/lib/integration-icons.ts · typescript · Apache-2.0
crm

Module exposing: faviconUrl, integrationIconUrl, normalizeDomain, hostname, safeHttpsUrl, hasAny, providerFallbackDomain

// Source: https://github.com/Second-Inc/second | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
export type IntegrationIconInput = {
  name?: string | null;
  domain?: string | null;
  endpointUrl?: string | null;
  iconUrl?: string | null;
  faviconUrl?: string | null;
  auth?: {
    providerKey?: string | null;
    scopes?: string[] | null;
  } | null;
};

function normalizeDomain(value?: string | null): string {
  if (!value) return "";
  return value
    .trim()
    .toLowerCase()
    .replace(/^https?:\/\//, "")
    .replace(/\/.*$/, "")
    .replace(/^www\./, "");
}

function hostname(value?: string | null): string {
  if (!value) return "";
  try {
    return normalizeDomai

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key