Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/shared/src/components/PlusUserBadge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react';
import type { PublicProfile } from '../lib/user';
import { SimpleTooltip } from './tooltips';
import { PlusUser } from './PlusUser';
import { plusUrl } from '../lib/constants';
import { plusApiCta, plusUrl } from '../lib/constants';
import Link from './utilities/Link';
import {
Typography,
Expand All @@ -29,7 +29,7 @@ export const PlusUserBadge = ({
size = IconSize.Size16,
}: Props): ReactElement | null => {
const { isPlus, logSubscriptionEvent } = usePlusSubscription();
const plusCta = 'Get API Access';
const plusCta = plusApiCta;

if (!user.isPlus) {
return null;
Expand Down Expand Up @@ -60,7 +60,7 @@ export const PlusUserBadge = ({
});
}}
>
{plusCta}!
{plusCta}
</Typography>
</Link>
)}
Expand Down
4 changes: 2 additions & 2 deletions packages/shared/src/components/UpgradeToPlus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { ButtonSize } from './buttons/Button';
import { ButtonColor, Button, ButtonVariant } from './buttons/Button';
import { DevPlusIcon } from './icons';
import Link from './utilities/Link';
import { plusUrl } from '../lib/constants';
import { plusApiCta, plusApiCtaShort, plusUrl } from '../lib/constants';
import { useViewSize, ViewSize } from '../hooks';
import { usePlusSubscription } from '../hooks/usePlusSubscription';
import { usePlusSale } from '../hooks/usePlusSale';
Expand Down Expand Up @@ -39,7 +39,7 @@ export const UpgradeToPlus = ({
const isFullCTAText = !isLaptop || isLaptopXL;
const { isPlus, logSubscriptionEvent } = usePlusSubscription();
const { isActive: isSaleActive } = usePlusSale();
const ctaCopy = { full: 'Get API Access', short: 'API access' };
const ctaCopy = { full: plusApiCta, short: plusApiCtaShort };
const content = isFullCTAText ? ctaCopy.full : ctaCopy.short;
const showSaleLabel = isSaleActive && !iconOnly;
const defaultColor = ButtonColor.Bacon;
Expand Down
8 changes: 8 additions & 0 deletions packages/shared/src/components/modals/IntroQuestModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ const introDestinationByEventType: Record<string, QuestDestination> = {
label: 'Profile',
path: '/settings/profile',
},
api_token_create: {
label: 'API settings',
path: '/settings/api',
},
api_profile_fetch: {
label: 'API settings',
path: '/settings/api',
},
};

const getExtensionIntroDestination = (
Expand Down
8 changes: 4 additions & 4 deletions packages/shared/src/components/plus/PlusList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ export const defaultFeatureList: Array<PlusItem> = [
export const plusFeatureListControl: Array<PlusItem> = [
{
id: 'public-api',
label: 'Public API access',
label: 'Full public API access and higher rate limits',
status: PlusItemStatus.Ready,
tooltip: `Build custom integrations and access your personalized feed programmatically. Full API access to feeds, bookmarks, search, and more.`,
tooltip: `Build custom integrations and access your personalized feed programmatically. Full API access to feeds, bookmarks, search, and more with higher rate limits.`,
},
{
id: 'presidential-briefing',
Expand Down Expand Up @@ -242,10 +242,10 @@ const reframeControlItem = (
export const plusFeatureListApiFirst: Array<PlusItem> = [
{
id: 'public-api',
label: 'Public API access',
label: 'Full public API access and higher rate limits',
status: PlusItemStatus.Ready,
highlight: true,
tooltip: `Endpoints for your feed, search, posts, and bookmarks. Plus pre-built integrations for Claude Code, Cursor, and Codex.`,
tooltip: `Full API access across your feed, search, posts, and bookmarks, with higher rate limits. Plus pre-built integrations for Claude Code, Cursor, and Codex.`,
},
reframeControlItem(
'custom feeds',
Expand Down
6 changes: 6 additions & 0 deletions packages/shared/src/components/quest/questDestinations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ export const getQuestDestination = (
return { label: 'Feedback', path: '/settings/feedback' };
case 'squad_join':
return { label: 'Squads', path: '/squads/discover' };
case 'api_token_create':
case 'api_profile_fetch':
case 'api_feed_fetch':
case 'api_bookmark':
case 'api_search':
return { label: 'API settings', path: '/settings/api' };
default:
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import { OtherFeedPage } from '../../../lib/query';
import type { SidebarSectionProps } from './common';
import {
gameCenterMilestoneSectionId,
plusApiCta,
plusApiCtaShort,
plusUrl,
webappUrl,
} from '../../../lib/constants';
Expand Down Expand Up @@ -48,7 +50,7 @@ export const MainSection = ({
const { isV2 } = useLayoutVariant();
const isPlus = user?.isPlus;
const { isActive: isSaleActive } = usePlusSale();
const ctaCopy = { full: 'Get API Access', short: 'API access' };
const ctaCopy = { full: plusApiCta, short: plusApiCtaShort };
const { value: showYearInReview } = useConditionalFeature({
feature: featureYearInReview,
shouldEvaluate: isLoggedIn,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ import {
} from '../../icons';
import type { SidebarSectionProps } from './common';
import { OtherFeedPage } from '../../../lib/query';
import { plusUrl, settingsUrl, webappUrl } from '../../../lib/constants';
import {
plusApiCta,
plusUrl,
settingsUrl,
webappUrl,
} from '../../../lib/constants';
import { LogEvent, TargetId } from '../../../lib/log';
import { useAuthContext } from '../../../contexts/AuthContext';
import { usePlusSubscription } from '../../../hooks';
Expand Down Expand Up @@ -90,10 +95,10 @@ export const ProfilePanelSection = ({
<ListIcon Icon={() => <FilterIcon secondary={active} />} />
),
},
// Non-Plus only: a purple "Get API Access" upgrade CTA (API access is a
// Plus perk). Plus users already have it, so it's hidden for them.
// Non-Plus only: a purple upgrade CTA for the higher API rate limits
// Plus carries. Plus users already have them, so it's hidden for them.
!isPlus && {
title: 'Get API Access',
title: plusApiCta,
path: plusUrl,
isForcedLink: true,
requiresLogin: true,
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/features/ask/components/AskFAQ.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const faq = [
{
title: 'Is this free?',
description:
'daily-dev-ask requires a Plus subscription and an API token. You can get Plus at daily.dev/plus and create a token in your API settings.',
'Yes. Any daily.dev account can create an API token in API settings and use daily-dev-ask. Plus adds full API access and higher rate limits, check it out at daily.dev/plus.',
},
{
title: 'What tools does it work with?',
Expand Down
32 changes: 15 additions & 17 deletions packages/shared/src/features/ask/components/AskInstall.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const methods: InstallMethod[] = [

export const AskInstall = (): ReactElement => {
const { displayToast } = useToastNotification();
const { isPlus } = usePlusSubscription();
const { isPlus, logSubscriptionEvent } = usePlusSubscription();
const { isLoggedIn, showLogin } = useAuthContext();
const { logEvent } = useLogContext();
const [expandedTool, setExpandedTool] = useState<string | null>(null);
Expand Down Expand Up @@ -116,17 +116,14 @@ export const AskInstall = (): ReactElement => {
color={TypographyColor.Secondary}
center
>
{isPlus ? (
You&apos;ll need an{' '}
<Link href={`${webappUrl}settings/api`} passHref>
<a className="font-bold text-text-primary underline">API token</a>
</Link>
. Pick your tool and install in seconds.
{!isPlus && (
<>
You&apos;ll need an{' '}
<Link href={`${webappUrl}settings/api`} passHref>
<a className="font-bold text-text-primary underline">API token</a>
</Link>
. Pick your tool and install in seconds.
</>
) : (
<>
Requires a{' '}
{' '}
<Link href={plusUrl} passHref>
<a
className="font-bold text-text-primary underline"
Expand All @@ -136,7 +133,12 @@ export const AskInstall = (): ReactElement => {
if (!isLoggedIn) {
e.preventDefault();
showLogin({ trigger: AuthTriggers.Plus });
return;
}
logSubscriptionEvent({
event_name: LogEvent.UpgradeSubscription,
target_id: TargetId.ApiAccess,
});
}}
onKeyDown={(e) => {
if (e.key === 'Enter' && !isLoggedIn) {
Expand All @@ -145,14 +147,10 @@ export const AskInstall = (): ReactElement => {
}
}}
>
Plus subscription
Upgrade to Plus
</a>
</Link>{' '}
and an{' '}
<Link href={`${webappUrl}settings/api`} passHref>
<a className="font-bold text-text-primary underline">API token</a>
</Link>
. Pick your tool and install in seconds.
for full API access and higher rate limits.
</>
)}
</Typography>
Expand Down
2 changes: 2 additions & 0 deletions packages/shared/src/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ export const webappUrl = process.env.NEXT_PUBLIC_WEBAPP_URL as string;
export const gameCenterMilestoneSectionId = 'milestone-quests';
export const onboardingUrl = `${webappUrl}onboarding`;
export const plusUrl = `${webappUrl}plus`;
export const plusApiCta = 'Full API access and higher rate limits';
export const plusApiCtaShort = 'Full API access';
export const managePlusUrl = 'https://r.daily.dev/billing';
export const plusDetailsUrl = 'https://r.daily.dev/plus-onboarding';
export const plusSuccessUrl = `${plusUrl}/success`;
Expand Down
1 change: 1 addition & 0 deletions packages/shared/src/lib/log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,7 @@ export enum TargetId {
MyProfile = 'my profile',
PlusBadge = 'plus badge',
PlusPage = 'plus page',
ApiAccess = 'api access',
Onboarding = 'onboarding',
BlockedWords = 'block words',
CustomFeed = 'custom feed',
Expand Down
8 changes: 4 additions & 4 deletions packages/webapp/pages/agents/ask/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
ButtonVariant,
} from '@dailydotdev/shared/src/components/buttons/Button';
import { DevPlusIcon } from '@dailydotdev/shared/src/components/icons';
import { plusUrl } from '@dailydotdev/shared/src/lib/constants';
import { plusApiCta, plusUrl } from '@dailydotdev/shared/src/lib/constants';
import { useLogContext } from '@dailydotdev/shared/src/contexts/LogContext';
import { LogEvent, TargetId } from '@dailydotdev/shared/src/lib/log';
import { useAuthContext } from '@dailydotdev/shared/src/contexts/AuthContext';
Expand Down Expand Up @@ -153,15 +153,15 @@ const AskPage = (): ReactElement => {
{!isPlus && (
<div className="plus-entry-gradient flex w-full flex-col items-center gap-3 overflow-hidden rounded-16 p-6">
<Typography type={TypographyType.Title3} bold center>
Unlock daily-dev-ask with Plus
{plusApiCta}
</Typography>
<Typography
type={TypographyType.Callout}
color={TypographyColor.Secondary}
center
>
daily-dev-ask requires a Plus subscription. Upgrade to get API
access and connect your AI tools.
daily-dev-ask works on any account. Plus raises your request
limits and unlocks the Plus-only endpoints.
</Typography>
<Button
tag="a"
Expand Down
Loading
Loading