Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

✨ Offer attribution removal as a Pro feature (#2797)

Luke Vella3e715874ce3d
diff --git a/.claude/launch.json b/.claude/launch.json
new file mode 100644
index 000000000..850169fa5
--- /dev/null
+++ b/.claude/launch.json
@@ -0,0 +1,18 @@
+{
+ "version": "0.0.1",
+ "configurations": [
+ {
+ "name": "web",
+ "runtimeExecutable": "env",
+ "runtimeArgs": [
+ "DEV_DOMAIN=ral1477.rallly.test",
+ "pnpm",
+ "--filter",
+ "@rallly/web",
+ "dev"
+ ],
+ "url": "https://ral1477.rallly.test",
+ "autoPort": true
+ }
+ ]
+}
diff --git a/apps/landing/public/locales/en/pricing.json b/apps/landing/public/locales/en/pricing.json
index 0f686a21b..a2e1184da 100644
--- a/apps/landing/public/locales/en/pricing.json
+++ b/apps/landing/public/locales/en/pricing.json
@@ -22,6 +22,7 @@
"pricingDescription": "Get started for free. No login required.",
"pricingSubtitle": "Upgrade to a paid plan to get access to premium features",
"pricingTitle": "Get started for free",
+ "removeAttribution": "Remove attribution",
"upgrade": "Upgrade",
"upgradeNowSaveLater": "Upgrade now, save later",
"whenPollInactive": "When does a poll become inactive?",
diff --git a/apps/landing/src/app/[locale]/(main)/pricing/pricing-table.tsx b/apps/landing/src/app/[locale]/(main)/pricing/pricing-table.tsx
index b09bb4d70..1f14e13f1 100644
--- a/apps/landing/src/app/[locale]/(main)/pricing/pricing-table.tsx
+++ b/apps/landing/src/app/[locale]/(main)/pricing/pricing-table.tsx
@@ -184,6 +184,14 @@ export function PriceTables() {
defaults="Keep polls indefinitely"
/>
</BillingPlanPerk>
+ <BillingPlanPerk pro={true}>
+ <Trans
+ t={t}
+ ns="pricing"
+ i18nKey="removeAttribution"
+ defaults="Remove attribution"
+ />
+ </BillingPlanPerk>
<BillingPlanPerk pro={true}>
<Trans
t={t}
diff --git a/apps/web/public/locales/en/app.json b/apps/web/public/locales/en/app.json
index 69c3328ab..a1fe33d2c 100644
--- a/apps/web/public/locales/en/app.json
+++ b/apps/web/public/locales/en/app.json
@@ -40,7 +40,6 @@
"adminSetupCta": "Make me an admin",
"adminSetupDescription": "Click the button below to make yourself an admin user.",
"adminSetupTitle": "Are you the admin?",
- "advancedSettingsDescription": "Customize poll behavior and participant permissions",
"allDay": "All day",
"allMembers": "All",
"allParticipants": "All Participants",
@@ -244,7 +243,6 @@
"downloadICSFile": "Download ICS File",
"duplicate": "Duplicate",
"duplicateDescription": "Create a new poll based on this one",
- "duplicatePollDescription": "Quickly create similar polls from existing ones",
"duplicateTitleDescription": "Hint: Give your new poll a unique title",
"duplicateTitleLabel": "Title",
"durationHours": "{count, plural, one {#h} other {#h}}",
@@ -309,8 +307,6 @@
"expiredVerificationCode": "This code has expired. Request a new one to continue.",
"exportToCsv": "Export to CSV",
"extendedPollLifetimeDescription": "Keep polls indefinitely",
- "featureNameAdvancedSettings": "Advanced Settings",
- "featureNameDuplicate": "Duplicate Poll",
"featureNameExtendedPollLifetime": "Extended Poll Lifetime",
"featureNameSchedule": "Schedule Poll",
"feedback": "Feedback",
@@ -600,6 +596,10 @@
"refreshLicense": "Refresh License",
"register": "Register",
"remove": "Remove",
+ "removeAttribution": "Remove Attribution",
+ "removeAttributionBenefitDescription": "Hide \"Powered by Rallly\" from your participants",
+ "removeAttributionSettingDescription": "Hide \"Powered by Rallly\" on invite pages and participant emails.",
+ "removeAttributionSettingTitle": "Remove attribution",
"removeImage": "Remove",
"removeLicense": "Remove License",
"removeLicenseDescription": "Are you sure you want to remove this license?",
diff --git a/apps/web/src/app/[locale]/(space)/settings/general/components/custom-branding-section.tsx b/apps/web/src/app/[locale]/(space)/settings/general/components/custom-branding-section.tsx
index dc5485b2d..cc3dcc453 100644
--- a/apps/web/src/app/[locale]/(space)/settings/general/components/custom-branding-section.tsx
+++ b/apps/web/src/app/[locale]/(space)/settings/general/components/custom-branding-section.tsx
@@ -8,6 +8,7 @@ import { Switch } from "@rallly/ui/switch";
import { Tooltip, TooltipContent, TooltipTrigger } from "@rallly/ui/tooltip";
import { CheckIcon, RotateCcwIcon } from "lucide-react";
import React from "react";
+import { IfCloudHosted } from "@/components/environment";
import {
PageSection,
PageSectionContent,
@@ -37,6 +38,7 @@ import { useAuthedUser } from "@/features/user/client";
import { Trans, useTranslation } from "@/i18n/client";
import { useSafeAction } from "@/lib/safe-action/client";
import { BrandingPreview } from "./branding-preview";
+import { RemoveAttributionSetting } from "./remove-attribution-setting";
import { SpaceSettingsForm } from "./space-settings-form";
export function CustomBrandingSection({
@@ -60,40 +62,28 @@ export function CustomBrandingSection({
const updateShowBranding = useSafeAction(updateSpaceShowBrandingAction);
const updateSpace = useSafeAction(updateSpaceAction);
- // Holds the toggled value until the post-action router refresh
- // delivers the updated space data, then defers to it.
- const [pendingShowBranding, setPendingShowBranding] = React.useState<
- boolean | null
- >(null);
- const showBranding = pendingShowBranding ?? space.showBranding;
-
- React.useEffect(() => {
- if (
- pendingShowBranding !== null &&
- space.showBranding === pendingShowBranding
- ) {
- setPendingShowBranding(null);
- }
- }, [space.showBranding, pendingShowBranding]);
+ // Optimistic value shown until the post-action router refresh delivers
+ // the updated space data; reverts automatically if the action fails.
+ const [showBranding, setOptimisticShowBranding] = React.useOptimistic(
+ space.showBranding,
+ );
- const handleToggle = async (newChecked: boolean) => {
+ const handleToggle = (newChecked: boolean) => {
if (isFree) {
showPayWall({ from: "custom-branding" });
return;
}
- setPendingShowBranding(newChecked);
+ React.startTransition(async () => {
+ setOptimisticShowBranding(newChecked);
+ const result = await updateShowBranding.executeAsync({
+ showBranding: newChecked,
+ });
- const result = await updateShowBranding.executeAsync({
- showBranding: newChecked,
+ if (!result?.serverError && !result?.validationErrors) {
+ toast.success(t("saved", { defaultValue: "Saved" }));
+ }
});
-
- if (result?.serverError || result?.validationErrors) {
- setPendingShowBranding(null);
- return;
- }
-
- toast.success(t("saved", { defaultValue: "Saved" }));
};
const persistColor = async (value: string | null) => {
@@ -155,6 +145,9 @@ export function CustomBrandingSection({
/>
</SettingControl>
</SettingRow>
+ <IfCloudHosted>
+ <RemoveAttributionSetting disabled={disabled} />
+ </IfCloudHosted>
<Setting>
<SettingTitle>
<Trans
diff --git a/apps/web/src/app/[locale]/(space)/settings/general/components/remove-attribution-setting.tsx b/apps/web/src/app/[locale]/(space)/settings/general/components/remove-attribution-setting.tsx
new file mode 100644
index 000000000..1022aa6af
--- /dev/null
+++ b/apps/web/src/app/[locale]/(space)/settings/general/components/remove-attribution-setting.tsx
@@ -0,0 +1,78 @@
+"use client";
+
+import { toast } from "@rallly/ui/sonner";
+import { Switch } from "@rallly/ui/switch";
+import React from "react";
+import {
+ Setting,
+ SettingControl,
+ SettingDescription,
+ SettingTitle,
+} from "@/components/setting";
+import { showPayWall, useIsFree } from "@/features/billing/client";
+import { ProBadge } from "@/features/billing/components/pro-badge";
+import { updateSpaceHideAttributionAction } from "@/features/space/actions";
+import { useSpace } from "@/features/space/client";
+import { Trans, useTranslation } from "@/i18n/client";
+import { useSafeAction } from "@/lib/safe-action/client";
+
+export function RemoveAttributionSetting({
+ disabled = false,
+}: {
+ disabled?: boolean;
+}) {
+ const { data: space } = useSpace();
+ const isFree = useIsFree();
+ const { t } = useTranslation();
+
+ const updateHideAttribution = useSafeAction(updateSpaceHideAttributionAction);
+
+ // Optimistic value shown until the post-action router refresh delivers
+ // the updated space data; reverts automatically if the action fails.
+ const [hideAttribution, setOptimisticHideAttribution] = React.useOptimistic(
+ space.hideAttribution,
+ );
+
+ const handleToggle = (newChecked: boolean) => {
+ if (isFree && newChecked) {
+ showPayWall({ from: "custom-branding", setting: "hide_attribution" });
+ return;
+ }
+
+ React.startTransition(async () => {
+ setOptimisticHideAttribution(newChecked);
+ const result = await updateHideAttribution.executeAsync({
+ hideAttribution: newChecked,
+ });
+
+ if (!result?.serverError && !result?.validationErrors) {
+ toast.success(t("saved", { defaultValue: "Saved" }));
+ }
+ });
+ };
+
+ return (
+ <Setting>
+ <SettingTitle>
+ <Trans
+ i18nKey="removeAttributionSettingTitle"
+ defaults="Remove attribution"
+ />
+ {space.tier !== "pro" && <ProBadge />}
+ </SettingTitle>
+ <SettingDescription>
+ <Trans
+ i18nKey="removeAttributionSettingDescription"
+ defaults='Hide "Powered by Rallly" on invite pages and participant emails.'
+ />
+ </SettingDescription>
+ <SettingControl>
+ <Switch
+ checked={hideAttribution}
+ onCheckedChange={handleToggle}
+ disabled={disabled || updateHideAttribution.isExecuting}
+ />
+ </SettingControl>
+ </Setting>
+ );
+}
diff --git a/apps/web/src/emails/branding.ts b/apps/web/src/emails/branding.ts
index cda34d82d..102fea767 100644
--- a/apps/web/src/emails/branding.ts
+++ b/apps/web/src/emails/branding.ts
@@ -1,6 +1,7 @@
import type { EmailBranding } from "@rallly/emails";
import { getInstanceBrandingConfig } from "@/features/branding/data";
+import { isSelfHosted } from "@/lib/constants";
import { resolveStorageUrl } from "@/lib/storage/resolve-storage-url";
/**
@@ -23,16 +24,25 @@ export async function getInstanceBranding(): Promise<EmailBranding> {
*/
export async function getSpaceBranding(space: {
showBranding: boolean;
+ hideAttribution: boolean;
primaryColor: string | null;
image: string | null;
}): Promise<EmailBranding> {
const instance = await getInstanceBranding();
- if (!space.showBranding) {
- return instance;
- }
return {
...instance,
- primaryColor: space.primaryColor ?? instance.primaryColor,
- logoUrl: space.image ? resolveStorageUrl(space.image) : instance.logoUrl,
+ // Space-level attribution removal is cloud-only; self-hosted attribution
+ // is licensed at instance level and already reflected in the instance
+ // branding.
+ hideAttribution:
+ instance.hideAttribution || (!isSelfHosted && space.hideAttribution),
+ ...(space.showBranding
+ ? {
+ primaryColor: space.primaryColor ?? instance.primaryColor,
+ logoUrl: space.image
+ ? resolveStorageUrl(space.image)
+ : instance.logoUrl,
+ }
+ : {}),
};
}
diff --git a/apps/web/src/features/billing/components/pay-wall-dialog.tsx b/apps/web/src/features/billing/components/pay-wall-dialog.tsx
index 1bb73f77c..702dc60b0 100644
--- a/apps/web/src/features/billing/components/pay-wall-dialog.tsx
+++ b/apps/web/src/features/billing/components/pay-wall-dialog.tsx
@@ -20,10 +20,9 @@ import {
CalendarCheckIcon,
CalendarSearchIcon,
ClockIcon,
- CopyIcon,
+ EyeOffIcon,
LifeBuoyIcon,
PaletteIcon,
- SettingsIcon,
SparklesIcon,
TimerResetIcon,
UserPlusIcon,
@@ -340,47 +339,32 @@ export function PayWallDialog({
}
/>
<KeyBenefitsItem
- icon={<CalendarCheckIcon />}
- title={
- <Trans
- i18nKey="featureNameSchedule"
- defaults="Schedule Poll"
- />
- }
- description={
- <Trans
- i18nKey="schedulePollDescription"
- defaults="Lock in the final meeting time and notify participants"
- />
- }
- />
- <KeyBenefitsItem
- icon={<CopyIcon />}
+ icon={<EyeOffIcon />}
title={
<Trans
- i18nKey="featureNameDuplicate"
- defaults="Duplicate Poll"
+ i18nKey="removeAttribution"
+ defaults="Remove Attribution"
/>
}
description={
<Trans
- i18nKey="duplicatePollDescription"
- defaults="Quickly create similar polls from existing ones"
+ i18nKey="removeAttributionBenefitDescription"
+ defaults='Hide "Powered by Rallly" from your participants'
/>
}
/>
<KeyBenefitsItem
- icon={<SettingsIcon />}
+ icon={<CalendarCheckIcon />}
title={
<Trans
- i18nKey="featureNameAdvancedSettings"
- defaults="Advanced Settings"
+ i18nKey="featureNameSchedule"
+ defaults="Schedule Poll"
/>
}
description={
<Trans
- i18nKey="advancedSettingsDescription"
- defaults="Customize poll behavior and participant permissions"
+ i18nKey="schedulePollDescription"
+ defaults="Lock in the final meeting time and notify participants"
/>
}
/>
diff --git a/apps/web/src/features/billing/webhook/mutations.ts b/apps/web/src/features/billing/webhook/mutations.ts
index aee951af6..8fce25cb6 100644
--- a/apps/web/src/features/billing/webhook/mutations.ts
+++ b/apps/web/src/features/billing/webhook/mutations.ts
@@ -47,7 +47,9 @@ async function syncSpaceTier(tx: Prisma.TransactionClient, spaceId: string) {
where: { id: spaceId },
data: {
tier,
- ...(tier === "hobby" ? { showBranding: false } : {}),
+ ...(tier === "hobby"
+ ? { showBranding: false, hideAttribution: false }
+ : {}),
},
});
diff --git a/apps/web/src/features/poll/components/poll-footer.tsx b/apps/web/src/features/poll/components/poll-footer.tsx
index 3d85d3fe8..eb8678555 100644
--- a/apps/web/src/features/poll/components/poll-footer.tsx
+++ b/apps/web/src/features/poll/components/poll-footer.tsx
@@ -9,7 +9,7 @@ export function PollFooter() {
const { hideAttribution } = useBranding();
const poll = usePoll();
- if (hideAttribution) {
+ if (hideAttribution || poll.space?.hideAttribution) {
return null;
}
diff --git a/apps/web/src/features/scheduled-event/data.ts b/apps/web/src/features/scheduled-event/data.ts
index 308c2f2a7..9aac646ce 100644
--- a/apps/web/src/features/scheduled-event/data.ts
+++ b/apps/web/src/features/scheduled-event/data.ts
@@ -51,7 +51,12 @@ export function getScheduledEventRsvpEmailData(eventId: string) {
timeZone: true,
user: { select: { name: true, email: true } },
space: {
- select: { showBranding: true, primaryColor: true, image: true },
+ select: {
+ showBranding: true,
+ hideAttribution: true,
+ primaryColor: true,
+ image: true,
+ },
},
},
});
diff --git a/apps/web/src/features/space/actions.ts b/apps/web/src/features/space/actions.ts
index 97ebe8e79..18f4bb2f4 100644
--- a/apps/web/src/features/space/actions.ts
+++ b/apps/web/src/features/space/actions.ts
@@ -2,6 +2,7 @@
import { subject } from "@casl/ability";
import { prisma } from "@rallly/database";
+import { createMiddleware } from "next-safe-action";
import * as z from "zod";
import { getActiveSpaceForUser } from "@/features/space/data";
import { defineAbilityForMember } from "@/features/space/member/ability";
@@ -11,17 +12,20 @@ import {
deleteSpace,
removeSpaceImage,
updateSpace,
+ updateSpaceHideAttribution,
updateSpaceImage,
updateSpaceShowBranding,
} from "@/features/space/mutations";
import {
createSpaceSchema,
spaceImageUploadSchema,
+ updateSpaceHideAttributionSchema,
updateSpaceImageSchema,
updateSpaceSchema,
updateSpaceShowBrandingSchema,
} from "@/features/space/schema";
import { setActiveSpace } from "@/features/user/mutations";
+import { isSelfHosted } from "@/lib/constants";
import { AppError } from "@/lib/errors/app-error";
import { identifyGroup, track } from "@/lib/posthog";
import {
@@ -30,8 +34,12 @@ import {
} from "@/lib/safe-action/server";
import { getImageUploadUrl } from "@/lib/storage/image-upload";
-async function requireSpaceWithUpdateAbility(user: { id: string }) {
- const space = await getActiveSpaceForUser(user.id);
+// Resolves the actor's active space, verifies they can update it, and
+// injects it into ctx as `space`.
+const spaceUpdateAbilityMiddleware = createMiddleware<{
+ ctx: { user: { id: string } };
+}>().define(async ({ ctx, next }) => {
+ const space = await getActiveSpaceForUser(ctx.user.id);
if (!space) {
throw new AppError({
@@ -40,7 +48,7 @@ async function requireSpaceWithUpdateAbility(user: { id: string }) {
});
}
- const ability = defineAbilityForMember({ user, space });
+ const ability = defineAbilityForMember({ user: ctx.user, space });
if (ability.cannot("update", subject("Space", space))) {
throw new AppError({
@@ -49,8 +57,8 @@ async function requireSpaceWithUpdateAbility(user: { id: string }) {
});
}
- return space;
-}
+ return next({ ctx: { space } });
+});
export const setActiveSpaceAction = authActionClient
.metadata({ actionName: "set_active_space" })
@@ -168,9 +176,10 @@ export const deleteSpaceAction = authActionClient
export const updateSpaceAction = authActionClient
.metadata({ actionName: "update_space" })
+ .use(spaceUpdateAbilityMiddleware)
.inputSchema(updateSpaceSchema)
.action(async ({ ctx, parsedInput }) => {
- const space = await requireSpaceWithUpdateAbility(ctx.user);
+ const { space } = ctx;
await updateSpace({
spaceId: space.id,
@@ -201,9 +210,10 @@ export const updateSpaceAction = authActionClient
export const updateSpaceShowBrandingAction = authActionClient
.metadata({ actionName: "update_space_show_branding" })
+ .use(spaceUpdateAbilityMiddleware)
.inputSchema(updateSpaceShowBrandingSchema)
.action(async ({ ctx, parsedInput }) => {
- const space = await requireSpaceWithUpdateAbility(ctx.user);
+ const { space } = ctx;
if (parsedInput.showBranding && space.tier !== "pro") {
throw new AppError({
@@ -236,15 +246,62 @@ export const updateSpaceShowBrandingAction = authActionClient
});
});
+export const updateSpaceHideAttributionAction = authActionClient
+ .metadata({ actionName: "update_space_hide_attribution" })
+ .use(spaceUpdateAbilityMiddleware)
+ .inputSchema(updateSpaceHideAttributionSchema)
+ .action(async ({ ctx, parsedInput }) => {
+ const { space } = ctx;
+
+ // Space-level attribution removal is a cloud feature. On self-hosted
+ // instances attribution is licensed at instance level (white label
+ // addon + HIDE_ATTRIBUTION), where every space reports as "pro".
+ if (isSelfHosted) {
+ throw new AppError({
+ code: "FORBIDDEN",
+ message: "Attribution removal is not available on this instance",
+ });
+ }
+
+ if (parsedInput.hideAttribution && space.tier !== "pro") {
+ throw new AppError({
+ code: "PAYMENT_REQUIRED",
+ message: "You need a Pro subscription to remove attribution",
+ });
+ }
+
+ await updateSpaceHideAttribution({
+ spaceId: space.id,
+ hideAttribution: parsedInput.hideAttribution,
+ });
+
+ identifyGroup({
+ groupType: "space",
+ groupKey: space.id,
+ properties: {
+ hide_attribution: parsedInput.hideAttribution,
+ },
+ });
+
+ track(ctx.user, {
+ event: "space_update_hide_attribution",
+ properties: {
+ hide_attribution: parsedInput.hideAttribution,
+ },
+ groups: {
+ space: space.id,
+ },
+ });
+ });
+
export const getSpaceImageUploadUrlAction = authActionClient
.metadata({ actionName: "get_space_image_upload_url" })
+ .use(spaceUpdateAbilityMiddleware)
.inputSchema(spaceImageUploadSchema)
.action(async ({ ctx, parsedInput }) => {
- const space = await requireSpaceWithUpdateAbility(ctx.user);
-
return await getImageUploadUrl({
keyPrefix: "spaces",
- entityId: space.id,
+ entityId: ctx.space.id,
fileType: parsedInput.fileType,
fileSize: parsedInput.fileSize,
});
@@ -252,9 +309,10 @@ export const getSpaceImageUploadUrlAction = authActionClient
export const updateSpaceImageAction = authActionClient
.metadata({ actionName: "update_space_image" })
+ .use(spaceUpdateAbilityMiddleware)
.inputSchema(updateSpaceImageSchema)
.action(async ({ ctx, parsedInput }) => {
- const space = await requireSpaceWithUpdateAbility(ctx.user);
+ const { space } = ctx;
if (!parsedInput.imageKey.startsWith(`spaces/${space.id}-`)) {
throw new AppError({
@@ -271,8 +329,7 @@ export const updateSpaceImageAction = authActionClient
export const removeSpaceImageAction = authActionClient
.metadata({ actionName: "remove_space_image" })
+ .use(spaceUpdateAbilityMiddleware)
.action(async ({ ctx }) => {
- const space = await requireSpaceWithUpdateAbility(ctx.user);
-
- await removeSpaceImage({ spaceId: space.id });
+ await removeSpaceImage({ spaceId: ctx.space.id });
});
diff --git a/apps/web/src/features/space/data.ts b/apps/web/src/features/space/data.ts
index b716c5f09..726066e04 100644
--- a/apps/web/src/features/space/data.ts
+++ b/apps/web/src/features/space/data.ts
@@ -137,6 +137,7 @@ export function createSpaceDTO(space: {
tier: DBSpaceTier;
primaryColor?: string | null;
showBranding: boolean;
+ hideAttribution: boolean;
memberCount: number;
seatCount: number;
}): SpaceDTO {
@@ -151,6 +152,7 @@ export function createSpaceDTO(space: {
image: space.image ?? undefined,
primaryColor: space.primaryColor ?? undefined,
showBranding: space.showBranding,
+ hideAttribution: space.hideAttribution,
};
}
@@ -219,6 +221,7 @@ export const listSpacesForUser = cache(async (userId: string) => {
tier: true,
primaryColor: true,
showBranding: true,
+ hideAttribution: true,
_count: { select: { members: true } },
subscriptions: {
where: { active: true },
diff --git a/apps/web/src/features/space/mutations.ts b/apps/web/src/features/space/mutations.ts
index 26a9f9760..3f26b43b2 100644
--- a/apps/web/src/features/space/mutations.ts
+++ b/apps/web/src/features/space/mutations.ts
@@ -70,6 +70,19 @@ export async function updateSpaceShowBranding({
});
}
+export async function updateSpaceHideAttribution({
+ spaceId,
+ hideAttribution,
+}: {
+ spaceId: string;
+ hideAttribution: boolean;
+}) {
+ await prisma.space.update({
+ where: { id: spaceId },
+ data: { hideAttribution },
+ });
+}
+
export async function updateSpaceImage({
spaceId,
imageKey,
diff --git a/apps/web/src/features/space/schema.ts b/apps/web/src/features/space/schema.ts
index c895b2a2f..8c71ff64f 100644
--- a/apps/web/src/features/space/schema.ts
+++ b/apps/web/src/features/space/schema.ts
@@ -23,6 +23,10 @@ export const updateSpaceShowBrandingSchema = z.object({
showBranding: z.boolean(),
});
+export const updateSpaceHideAttributionSchema = z.object({
+ hideAttribution: z.boolean(),
+});
+
export const spaceImageUploadSchema = z.object({
fileType: z.enum(["image/jpeg", "image/png"]),
fileSize: z.number(),
diff --git a/apps/web/src/features/space/types.ts b/apps/web/src/features/space/types.ts
index e20c43464..43ecc0fa6 100644
--- a/apps/web/src/features/space/types.ts
+++ b/apps/web/src/features/space/types.ts
@@ -17,4 +17,5 @@ export type SpaceDTO = {
image?: string;
primaryColor?: string;
showBranding: boolean;
+ hideAttribution: boolean;
};
diff --git a/apps/web/src/trpc/routers/polls.ts b/apps/web/src/trpc/routers/polls.ts
index 887c7d8d0..d1e2bc548 100644
--- a/apps/web/src/trpc/routers/polls.ts
+++ b/apps/web/src/trpc/routers/polls.ts
@@ -17,6 +17,7 @@ import {
import { MAX_POLL_DESCRIPTION_LENGTH } from "@/features/poll/schema";
import { formatEventDateTime } from "@/features/scheduled-event/utils";
import { getActiveSpaceForUser } from "@/features/space/data";
+import { isSelfHosted } from "@/lib/constants";
import { dayjs } from "@/lib/dayjs";
import { identifyGroup, track } from "@/lib/posthog";
import { createIcsEvent } from "@/lib/utils/ics";
@@ -639,6 +640,7 @@ export const polls = router({
image: true,
tier: true,
showBranding: true,
+ hideAttribution: true,
primaryColor: true,
},
},
@@ -707,6 +709,15 @@ export const polls = router({
return {
...res,
+ // Space-level attribution removal is cloud-only; self-hosted
+ // attribution is licensed at instance level via the white label
+ // addon.
+ space: res.space
+ ? {
+ ...res.space,
+ hideAttribution: !isSelfHosted && res.space.hideAttribution,
+ }
+ : null,
canManage,
inviteLink,
event,
@@ -746,6 +757,7 @@ export const polls = router({
space: {
select: {
showBranding: true,
+ hideAttribution: true,
primaryColor: true,
image: true,
},
diff --git a/apps/web/src/trpc/routers/polls/participants.ts b/apps/web/src/trpc/routers/polls/participants.ts
index d72205b85..bd8645f7a 100644
--- a/apps/web/src/trpc/routers/polls/participants.ts
+++ b/apps/web/src/trpc/routers/polls/participants.ts
@@ -341,6 +341,7 @@ export const participants = router({
id: true,
tier: true,
showBranding: true,
+ hideAttribution: true,
primaryColor: true,
image: true,
},
diff --git a/packages/database/prisma/migrations/20260731000000_add_space_hide_attribution/migration.sql b/packages/database/prisma/migrations/20260731000000_add_space_hide_attribution/migration.sql
new file mode 100644
index 000000000..cde4c2cdd
--- /dev/null
+++ b/packages/database/prisma/migrations/20260731000000_add_space_hide_attribution/migration.sql
@@ -0,0 +1,2 @@
+-- AlterTable
+ALTER TABLE "spaces" ADD COLUMN "hide_attribution" BOOLEAN NOT NULL DEFAULT false;
diff --git a/packages/database/prisma/models/space.prisma b/packages/database/prisma/models/space.prisma
index 7f3535b9d..5ec95e028 100644
--- a/packages/database/prisma/models/space.prisma
+++ b/packages/database/prisma/models/space.prisma
@@ -1,13 +1,14 @@
model Space {
- id String @id @default(uuid())
- name String
- image String?
- ownerId String @map("owner_id")
- tier SpaceTier @default(hobby)
- primaryColor String? @map("primary_color")
- showBranding Boolean @default(false) @map("show_branding")
- createdAt DateTime @default(now()) @map("created_at")
- updatedAt DateTime @updatedAt @map("updated_at")
+ id String @id @default(uuid())
+ name String
+ image String?
+ ownerId String @map("owner_id")
+ tier SpaceTier @default(hobby)
+ primaryColor String? @map("primary_color")
+ showBranding Boolean @default(false) @map("show_branding")
+ hideAttribution Boolean @default(false) @map("hide_attribution")
+ createdAt DateTime @default(now()) @map("created_at")
+ updatedAt DateTime @updatedAt @map("updated_at")
owner User @relation("UserSpaces", fields: [ownerId], references: [id], onDelete: Cascade)
polls Poll[]