* WIP teams billing page * WIP * Create settings page * Remove unused imports * Create stripe customer on team creation * Add Stripe ids to team record * Add Stripe price ids for team to .env * Create & delete Stripe customers * Add string * Merge branch 'main' into v2/teams-billing * Create checkout session when creating team * Create webhook to update team with Stripe ids * Add Stripe migration files * Move deleting team from Stripe under ee * Some cleanup * Merge branch 'v2/teams-billing' of https://github.com/calcom/cal.com into v2/teams-billing * Small clean up * Link to team's portal page * Fix types * Fix type errors * Fix type errors * Fix type error * Delete old files & type fixes * Address feedback * Fix type errors * Removes team creation modal * WIP * Removed billing frequency from team creation * Add Stripe check for delete team customer * Merge branch 'v2/teams-billing' of https://github.com/calcom/cal.com into v2/teams-billing * Add high level form to create new team * WIP * Add new team to form * Validate for invited members * Add translations * WIP * Add validation for team name * Add validation to team slug * Clean up * Fix type error * Fix type errors * WIP * Abstract invite members function * Add subscription status column * Hide pending teams from settings * Send email on paid subscription * WIP * Sync packages * Add team subscription cols to schema * WIP * Matches locks vite version to <3 * Removed subscriptionStatus * WIP * Fix warning * Query optimizations * WIP * Cleanup * Wip * WIP * Runtime error fixes * Cancellation fixes * Delete team fixes * Cleanup * Type fixes * Allows to check memebership in getTeamWithMembers * Adds team creation tests * Cleanup * Cleanup * Restored change * Updated copy * Moved component * Cleanup * Fix team members view * Cleanup * Adds failsafe for skipping publishing on update * Cleanup * Feedback * More feedback * Cleanup * Cleanup * Feedback * Feedback * Feedback * Adds edge-case for slug conflicts * Feedback * e2e fixes Co-authored-by: Joe Au-Yeung <j.auyeung419@gmail.com> Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com>
46 lines
2.6 KiB
TypeScript
46 lines
2.6 KiB
TypeScript
const VERCEL_URL = process.env.VERCEL_URL ? `https://${process.env.VERCEL_URL}` : "";
|
|
const RAILWAY_STATIC_URL = process.env.RAILWAY_STATIC_URL ? `https://${process.env.RAILWAY_STATIC_URL}` : "";
|
|
const HEROKU_URL = process.env.HEROKU_APP_NAME ? `https://${process.env.HEROKU_APP_NAME}.herokuapp.com` : "";
|
|
export const WEBAPP_URL =
|
|
process.env.NEXT_PUBLIC_WEBAPP_URL || VERCEL_URL || RAILWAY_STATIC_URL || HEROKU_URL;
|
|
/** @deprecated use `WEBAPP_URL` */
|
|
export const BASE_URL = WEBAPP_URL;
|
|
export const WEBSITE_URL = process.env.NEXT_PUBLIC_WEBSITE_URL || "https://cal.com";
|
|
|
|
// This is the URL from which all Cal Links and their assets are served.
|
|
// Use website URL to make links shorter(cal.com and not app.cal.com)
|
|
// As website isn't setup for preview environments, use the webapp url instead
|
|
export const CAL_URL = new URL(WEBAPP_URL).hostname.endsWith(".vercel.app") ? WEBAPP_URL : WEBSITE_URL;
|
|
|
|
export const CONSOLE_URL =
|
|
new URL(WEBAPP_URL).hostname.endsWith(".cal.dev") || process.env.NODE_ENV !== "production"
|
|
? `https://console.cal.dev`
|
|
: `https://console.cal.com`;
|
|
export const IS_SELF_HOSTED = !(
|
|
new URL(WEBAPP_URL).hostname.endsWith(".cal.dev") || new URL(WEBAPP_URL).hostname.endsWith(".cal.com")
|
|
);
|
|
export const EMBED_LIB_URL = process.env.NEXT_PUBLIC_EMBED_LIB_URL || `${WEBAPP_URL}/embed/embed.js`;
|
|
export const IS_PRODUCTION = process.env.NODE_ENV === "production";
|
|
export const TRIAL_LIMIT_DAYS = 14;
|
|
export const HOSTED_CAL_FEATURES = process.env.HOSTED_CAL_FEATURES || BASE_URL === "https://app.cal.com";
|
|
/** @deprecated use `WEBAPP_URL` */
|
|
export const NEXT_PUBLIC_BASE_URL = process.env.NEXT_PUBLIC_WEBAPP_URL || `https://${process.env.VERCEL_URL}`;
|
|
export const LOGO = "/calcom-logo-white-word.svg";
|
|
export const LOGO_ICON = "/cal-com-icon-white.svg";
|
|
export const ROADMAP = "https://cal.com/roadmap";
|
|
export const DESKTOP_APP_LINK = "https://cal.com/download";
|
|
export const JOIN_SLACK = "https://cal.com/slack";
|
|
export const POWERED_BY_URL = `${WEBSITE_URL}/?utm_source=embed&utm_medium=powered-by-button`;
|
|
export const DOCS_URL = "https://docs.cal.com";
|
|
export const DEVELOPER_DOCS = "https://developer.cal.com";
|
|
export const SEO_IMG_DEFAULT = `${WEBSITE_URL}/og-image.png`;
|
|
export const SEO_IMG_OGIMG = `${CAL_URL}/api/social/og/image`;
|
|
export const SEO_IMG_OGIMG_VIDEO = `${WEBSITE_URL}/video-og-image.png`;
|
|
export const IS_STRIPE_ENABLED = !!(
|
|
process.env.STRIPE_CLIENT_ID &&
|
|
process.env.NEXT_PUBLIC_STRIPE_PUBLIC_KEY &&
|
|
process.env.STRIPE_PRIVATE_KEY
|
|
);
|
|
/** Self hosted shouldn't checkout when creating teams */
|
|
export const IS_TEAM_BILLING_ENABLED = IS_STRIPE_ENABLED && !IS_SELF_HOSTED;
|