Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

feat: expand onboarding with product selection and metrics

Scott Wilson1b35167193b0
diff --git a/backend/src/@types/knex.d.ts b/backend/src/@types/knex.d.ts
index 594cf5cd45..f5a348a998 100644
--- a/backend/src/@types/knex.d.ts
+++ b/backend/src/@types/knex.d.ts
@@ -641,6 +641,9 @@ import {
TServiceTokens,
TServiceTokensInsert,
TServiceTokensUpdate,
+ TSignupOnboardingResponses,
+ TSignupOnboardingResponsesInsert,
+ TSignupOnboardingResponsesUpdate,
TSlackIntegrations,
TSlackIntegrationsInsert,
TSlackIntegrationsUpdate,
@@ -1148,6 +1151,11 @@ declare module "knex/types/tables" {
TIncidentContactsUpdate
>;
[TableName.UserAction]: KnexOriginal.CompositeTableType<TUserActions, TUserActionsInsert, TUserActionsUpdate>;
+ [TableName.SignupOnboardingResponse]: KnexOriginal.CompositeTableType<
+ TSignupOnboardingResponses,
+ TSignupOnboardingResponsesInsert,
+ TSignupOnboardingResponsesUpdate
+ >;
[TableName.SuperAdmin]: KnexOriginal.CompositeTableType<TSuperAdmin, TSuperAdminInsert, TSuperAdminUpdate>;
[TableName.Project]: KnexOriginal.CompositeTableType<TProjects, TProjectsInsert, TProjectsUpdate>;
[TableName.ProjectSshConfig]: KnexOriginal.CompositeTableType<
diff --git a/backend/src/db/schemas/index.ts b/backend/src/db/schemas/index.ts
index f81a71be50..bce2aa1fdf 100644
--- a/backend/src/db/schemas/index.ts
+++ b/backend/src/db/schemas/index.ts
@@ -248,6 +248,7 @@ export * from "./secret-versions-v2";
export * from "./secrets";
export * from "./secrets-v2";
export * from "./service-tokens";
+export * from "./signup-onboarding-responses";
export * from "./slack-integrations";
export * from "./ssh-certificate-authorities";
export * from "./ssh-certificate-authority-secrets";
diff --git a/backend/src/db/schemas/models.ts b/backend/src/db/schemas/models.ts
index 153f6abc07..074c3cbecf 100644
--- a/backend/src/db/schemas/models.ts
+++ b/backend/src/db/schemas/models.ts
@@ -62,6 +62,7 @@ export enum TableName {
IncidentContact = "incident_contacts",
UserAction = "user_actions",
UserSecretActivation = "user_secret_activation",
+ SignupOnboardingResponse = "signup_onboarding_responses",
SuperAdmin = "super_admin",
RateLimit = "rate_limit",
ProjectSshConfig = "project_ssh_configs",
diff --git a/backend/src/server/routes/index.ts b/backend/src/server/routes/index.ts
index 489efc3260..ab172271d0 100644
--- a/backend/src/server/routes/index.ts
+++ b/backend/src/server/routes/index.ts
@@ -257,6 +257,7 @@ import {
import { authDALFactory } from "@app/services/auth/auth-dal";
import { authLoginServiceFactory } from "@app/services/auth/auth-login-service";
import { authPaswordServiceFactory } from "@app/services/auth/auth-password-service";
+import { signupOnboardingResponseDALFactory } from "@app/services/auth/auth-signup-onboarding-dal";
import { authSignupServiceFactory } from "@app/services/auth/auth-signup-service";
import { mfaLockoutServiceFactory } from "@app/services/auth/mfa-lockout-service";
import { tokenDALFactory } from "@app/services/auth-token/auth-token-dal";
@@ -595,6 +596,7 @@ export const registerRoutes = async (
const userDAL = userDALFactory(db);
const userAliasDAL = userAliasDALFactory(db);
const authDAL = authDALFactory(db);
+ const signupOnboardingResponseDAL = signupOnboardingResponseDALFactory(db);
const authTokenDAL = tokenDALFactory(db);
const orgDAL = orgDALFactory(db);
const orgMembershipDAL = orgMembershipDALFactory(db);
@@ -1394,7 +1396,8 @@ export const registerRoutes = async (
orgDAL,
orgService,
loginService,
- emailDomainDAL
+ emailDomainDAL,
+ signupOnboardingResponseDAL
});
const microsoftTeamsService = microsoftTeamsServiceFactory({
diff --git a/backend/src/server/routes/v1/invite-org-router.ts b/backend/src/server/routes/v1/invite-org-router.ts
index d11dc71660..2dcfe1e141 100644
--- a/backend/src/server/routes/v1/invite-org-router.ts
+++ b/backend/src/server/routes/v1/invite-org-router.ts
@@ -1,7 +1,10 @@
import { z } from "zod";
-import { AccessScope, OrgMembershipRole } from "@app/db/schemas";
+import { AccessScope, OrgMembershipRole, ProjectMembershipRole } from "@app/db/schemas";
+import { EventType } from "@app/ee/services/audit-log/audit-log-types";
+import { PamProductRole } from "@app/ee/services/pam/pam-enums";
import { unique } from "@app/lib/fn";
+import { logger } from "@app/lib/logger";
import { sanitizeEmail } from "@app/lib/validator";
import { inviteUserRateLimit, smtpRateLimit } from "@app/server/config/rateLimiter";
import { getTelemetryDistinctId } from "@app/server/lib/telemetry";
@@ -27,7 +30,11 @@ export const registerInviteOrgRouter = async (server: FastifyZodProvider) => {
.max(100)
.transform((val) => unique(val.map((el) => sanitizeEmail(el)))),
organizationId: z.string().trim(),
- organizationRoleSlug: z.string().default(OrgMembershipRole.Member)
+ organizationRoleSlug: z.string().default(OrgMembershipRole.Member),
+ // Signup-created projects the invitees get member access to.
+ projectIds: z.string().trim().array().max(5).optional(),
+ // Grants membership on the org's consolidated PAM project (PAM has no signup-created project).
+ grantPamAccess: z.boolean().optional()
}),
response: {
200: z.object({
@@ -59,6 +66,66 @@ export const registerInviteOrgRouter = async (server: FastifyZodProvider) => {
}
});
+ // Best-effort: the org invite already succeeded, so a project-side failure must not fail the request.
+ if (req.body.projectIds?.length) {
+ for await (const projectId of req.body.projectIds) {
+ try {
+ await server.services.membershipUser.createMembership({
+ permission: req.permission,
+ scopeData: {
+ scope: AccessScope.Project,
+ orgId: req.permission.orgId,
+ projectId
+ },
+ data: {
+ usernames: req.body.inviteeEmails,
+ roles: [{ isTemporary: false, role: ProjectMembershipRole.Member }]
+ }
+ });
+ } catch (err) {
+ logger.error(err, `Failed to grant invitees access to project [projectId=${projectId}]`);
+ }
+ }
+ }
+
+ // PAM must go through its product-membership service so role validation, metering,
+ // and access-request cleanup apply.
+ if (req.body.grantPamAccess) {
+ try {
+ const pamProjectId = await server.services.pamProjectResolver.resolve(req.permission.orgId);
+ const { memberships } = await server.services.pamMembership.addProductUserMembers({
+ projectId: pamProjectId,
+ actorId: req.permission.id,
+ actor: req.permission.type,
+ actorOrgId: req.permission.orgId,
+ actorAuthMethod: req.permission.authMethod,
+ userIds: [],
+ emails: req.body.inviteeEmails,
+ role: PamProductRole.Member
+ });
+
+ for await (const membership of memberships) {
+ await server.services.auditLog.createAuditLog({
+ ...req.auditLogInfo,
+ orgId: req.permission.orgId,
+ projectId: pamProjectId,
+ event: {
+ type: EventType.PAM_PRODUCT_MEMBER_ADD,
+ metadata: { userId: membership.userId, role: membership.role }
+ }
+ });
+ void server.services.telemetry.sendPostHogEvents({
+ event: PostHogEventTypes.PamProductMemberAdded,
+ distinctId: getTelemetryDistinctId(req),
+ organizationId: req.permission.orgId,
+ properties: { orgId: req.permission.orgId }
+ });
+ }
+ } catch (err) {
+ logger.error(err, "Failed to grant invitees PAM access");
+ }
+ }
+
await server.services.telemetry.sendPostHogEvents({
event: PostHogEventTypes.UserOrgInvitation,
distinctId: getTelemetryDistinctId(req),
diff --git a/backend/src/server/routes/v3/signup-router.ts b/backend/src/server/routes/v3/signup-router.ts
index 7e47219a4d..3720f0c146 100644
--- a/backend/src/server/routes/v3/signup-router.ts
+++ b/backend/src/server/routes/v3/signup-router.ts
@@ -2,11 +2,15 @@ import { z } from "zod";
import { getConfig } from "@app/lib/config/env";
import { ForbiddenRequestError } from "@app/lib/errors";
+import { logger } from "@app/lib/logger";
import { PasswordPolicySchema } from "@app/lib/validator/password-policy";
import { authRateLimit, smtpRateLimit } from "@app/server/config/rateLimiter";
import { addAuthOriginDomainCookie } from "@app/server/lib/cookie";
import { GenericResourceNameSchema } from "@app/server/lib/schemas";
+import { getTelemetryDistinctId } from "@app/server/lib/telemetry";
+import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
import { CompleteAccountType } from "@app/services/auth/auth-signup-type";
+import { AuthMode } from "@app/services/auth/auth-type";
import { getServerCfg } from "@app/services/super-admin/super-admin-service";
import { PostHogEventTypes } from "@app/services/telemetry/telemetry-types";
@@ -204,4 +208,111 @@ export const registerSignupRouter = async (server: FastifyZodProvider) => {
return { message: "Successfully set up account", user, token: accessToken };
}
});
+
+ server.route({
+ url: "/onboarding",
+ method: "POST",
+ config: {
+ rateLimit: authRateLimit
+ },
+ schema: {
+ operationId: "recordSignupOnboardingV3",
+ body: z.object({
+ selectedProduct: z
+ .enum(["secret-manager", "cert-manager", "kms", "secret-scanning", "pam", "exploring"])
+ .optional(),
+ // An empty array means "just exploring".
+ selectedProducts: z
+ .enum(["secret-manager", "cert-manager", "kms", "secret-scanning", "pam"])
+ .array()
+ .max(5)
+ .optional(),
+ launchDestination: z
+ .enum(["secret-manager", "cert-manager", "kms", "secret-scanning", "pam", "organization-overview"])
+ .optional(),
+ attributionSource: z.string().trim().max(512).optional()
+ }),
+ response: {
+ 200: z.object({
+ message: z.string()
+ })
+ }
+ },
+ onRequest: verifyAuth([AuthMode.JWT]),
+ handler: async (req) => {
+ const distinctId = getTelemetryDistinctId(req);
+ const organizationId = req.permission.orgId;
+
+ // Persisted for SQL analytics alongside the PostHog events; a DB failure must not
+ // take the telemetry down with it.
+ if (organizationId) {
+ try {
+ await server.services.signup.recordOnboardingResponse({
+ userId: req.permission.id,
+ orgId: organizationId,
+ selectedProducts: req.body.selectedProducts,
+ launchDestination: req.body.launchDestination,
+ attributionSource: req.body.attributionSource
+ });
+ } catch (err) {
+ logger.error(err, "Failed to record signup onboarding response");
+ }
+ }
+
+ if (req.body.selectedProduct) {
+ void server.services.telemetry.sendPostHogEvents({
+ event: PostHogEventTypes.SignupProductSelected,
+ distinctId,
+ ...(organizationId ? { organizationId } : {}),
+ properties: {
+ product: req.body.selectedProduct
+ }
+ });
+ }
+
+ if (req.body.selectedProducts) {
+ const { selectedProducts } = req.body;
+ const isExploring = selectedProducts.length === 0;
+ void server.services.telemetry.sendPostHogEvents({
+ event: PostHogEventTypes.SignupProductsSubmitted,
+ distinctId,
+ ...(organizationId ? { organizationId } : {}),
+ properties: {
+ products: selectedProducts,
+ productCount: selectedProducts.length,
+ isExploring,
+ $set_once: {
+ signupProducts: selectedProducts,
+ signupProductCount: selectedProducts.length,
+ signupIsExploring: isExploring
+ }
+ }
+ });
+ }
+
+ if (req.body.launchDestination) {
+ void server.services.telemetry.sendPostHogEvents({
+ event: PostHogEventTypes.SignupLaunchDestinationSelected,
+ distinctId,
+ ...(organizationId ? { organizationId } : {}),
+ properties: {
+ launchDestination: req.body.launchDestination
+ }
+ });
+ }
+
+ if (req.body.attributionSource) {
+ void server.services.telemetry.sendPostHogEvents({
+ event: PostHogEventTypes.SignupAttributionProvided,
+ distinctId,
+ ...(organizationId ? { organizationId } : {}),
+ properties: {
+ attributionSource: req.body.attributionSource
+ }
+ });
+ }
+
+ return { message: "Onboarding response recorded" };
+ }
+ });
};
diff --git a/backend/src/services/auth/auth-signup-service.ts b/backend/src/services/auth/auth-signup-service.ts
index c243ac4b96..ec38527071 100644
--- a/backend/src/services/auth/auth-signup-service.ts
+++ b/backend/src/services/auth/auth-signup-service.ts
@@ -1,4 +1,4 @@
-import { AccessScope, OrgMembershipStatus } from "@app/db/schemas";
+import { AccessScope, OrgMembershipStatus, TSignupOnboardingResponsesUpdate } from "@app/db/schemas";
import { TEmailDomainDALFactory } from "@app/ee/services/email-domain/email-domain-dal";
import { findOrgIdByVerifiedDomain } from "@app/ee/services/email-domain/email-domain-fns";
import { getConfig } from "@app/lib/config/env";
@@ -17,7 +17,8 @@ import { TUserAliasDALFactory } from "../user-alias/user-alias-dal";
import { TAuthDALFactory } from "./auth-dal";
import { extractBearerToken } from "./auth-fns";
import { TAuthLoginFactory } from "./auth-login-service";
-import { CompleteAccountType, TCompleteAccountDTO } from "./auth-signup-type";
+import { TSignupOnboardingResponseDALFactory } from "./auth-signup-onboarding-dal";
+import { CompleteAccountType, TCompleteAccountDTO, TRecordSignupOnboardingDTO } from "./auth-signup-type";
import { AuthMethod, AuthModeSignUpTokenPayload, AuthTokenType } from "./auth-type";
type TAuthSignupDep = {
@@ -30,6 +31,7 @@ type TAuthSignupDep = {
smtpService: TSmtpService;
loginService: Pick<TAuthLoginFactory, "generateUserTokens">;
emailDomainDAL: Pick<TEmailDomainDALFactory, "findOne">;
+ signupOnboardingResponseDAL: Pick<TSignupOnboardingResponseDALFactory, "upsert">;
};
const DUMMY_USER_ID = "00000000-0000-0000-0000-000000000000";
@@ -44,7 +46,8 @@ export const authSignupServiceFactory = ({
orgService,
orgDAL,
loginService,
- emailDomainDAL
+ emailDomainDAL,
+ signupOnboardingResponseDAL
}: TAuthSignupDep) => {
// First step of signup to send OTP email
const beginEmailSignupProcess = async (email: string): Promise<{ cooldownSeconds: number }> => {
@@ -311,9 +314,35 @@ export const authSignupServiceFactory = ({
};
};
+ const recordOnboardingResponse = async ({
+ userId,
+ orgId,
+ selectedProducts,
+ launchDestination,
+ attributionSource
+ }: TRecordSignupOnboardingDTO) => {
+ const answers: TSignupOnboardingResponsesUpdate = {};
+ if (selectedProducts) {
+ answers.selectedProducts = selectedProducts;
+ answers.isExploring = selectedProducts.length === 0;
+ }
+ if (launchDestination) answers.launchDestination = launchDestination;
+ if (attributionSource) answers.attributionSource = attributionSource;
+ if (!Object.keys(answers).length) return;
+
+ // Answers arrive across separate requests; merge them into one row per signup.
+ await signupOnboardingResponseDAL.upsert(
+ [{ userId, orgId, ...answers }],
+ ["userId", "orgId"],
+ undefined,
+ Object.keys(answers) as (keyof TSignupOnboardingResponsesUpdate)[]
+ );
+ };
+
return {
beginEmailSignupProcess,
verifyEmailSignup,
- completeAccount
+ completeAccount,
+ recordOnboardingResponse
};
};
diff --git a/backend/src/services/auth/auth-signup-type.ts b/backend/src/services/auth/auth-signup-type.ts
index b8e6f15154..1b30c66aca 100644
--- a/backend/src/services/auth/auth-signup-type.ts
+++ b/backend/src/services/auth/auth-signup-type.ts
@@ -26,5 +26,13 @@ type TCompleteAccountAlias = TCompleteAccountBase & {
export type TCompleteAccountDTO = TCompleteAccountEmail | TCompleteAccountAlias;
+export type TRecordSignupOnboardingDTO = {
+ userId: string;
+ orgId: string;
+ selectedProducts?: string[];
+ launchDestination?: string;
+ attributionSource?: string;
+};
+
// Keep old type as alias for any remaining references
export type TCompleteAccountSignupDTO = TCompleteAccountEmail;
diff --git a/backend/src/services/telemetry/telemetry-types.ts b/backend/src/services/telemetry/telemetry-types.ts
index e8f5fb0ff3..cb5c7233d9 100644
--- a/backend/src/services/telemetry/telemetry-types.ts
+++ b/backend/src/services/telemetry/telemetry-types.ts
@@ -33,6 +33,10 @@ export enum PostHogEventTypes {
SecretDeleted = "secrets deleted",
AdminInit = "admin initialization",
UserSignedUp = "User Signed Up",
+ SignupProductSelected = "Signup Product Selected",
+ SignupProductsSubmitted = "Signup Products Submitted",
+ SignupLaunchDestinationSelected = "Signup Launch Destination Selected",
+ SignupAttributionProvided = "Signup Attribution Provided",
UserLoginV2 = "User Login V2",
SecretRotated = "secrets rotated",
SecretScannerFull = "historical cloud secret scan",
@@ -319,6 +323,45 @@ export type TUserSignedUpEvent = {
};
};
+export type TSignupProductSelectedEvent = {
+ event: PostHogEventTypes.SignupProductSelected;
+ properties: {
+ product: string;
+ };
+};
+
+/**
+ * One summary event per signup (TSignupProductSelectedEvent is the per-product breakdown).
+ * $set_once mirrors the selection onto the person record for cohorting.
+ */
+export type TSignupProductsSubmittedEvent = {
+ event: PostHogEventTypes.SignupProductsSubmitted;
+ properties: {
+ products: string[];
+ productCount: number;
+ isExploring: boolean;
+ $set_once: {
+ signupProducts: string[];
+ signupProductCount: number;
+ signupIsExploring: boolean;
+ };
+ };
+};
+
+export type TSignupLaunchDestinationSelectedEvent = {
+ event: PostHogEventTypes.SignupLaunchDestinationSelected;
+ properties: {
+ launchDestination: string;
+ };
+};
+
+export type TSignupAttributionProvidedEvent = {
+ event: PostHogEventTypes.SignupAttributionProvided;
+ properties: {
+ attributionSource: string;
+ };
+};
+
export type TOrganizationCreatedEvent = {
event: PostHogEventTypes.OrganizationCreated;
properties: {
@@ -2000,6 +2043,10 @@ export type TPostHogEvent = {
| TSecretModifiedEvent
| TAdminInitEvent
| TUserSignedUpEvent
+ | TSignupProductSelectedEvent
+ | TSignupProductsSubmittedEvent
+ | TSignupLaunchDestinationSelectedEvent
+ | TSignupAttributionProvidedEvent
| TUserLoginV2Event
| TSecretScannerEvent
| TUserOrgInvitedEvent
diff --git a/frontend/public/locales/en/translations.json b/frontend/public/locales/en/translations.json
index c83c477a99..443a58bc30 100644
--- a/frontend/public/locales/en/translations.json
+++ b/frontend/public/locales/en/translations.json
@@ -157,7 +157,7 @@
"step2-resend-submit": "Resend",
"step2-resend-progress": "Resending...",
"step2-spam-alert": "Make sure to check your spam inbox.",
- "step3-message": "Almost there!",
+ "step3-message": "Create your account",
"step4-message": "Save your Emergency Kit",
"step4-description1": "If you get locked out of your account, your Emergency Kit is the only way to sign in.",
"step4-description2": "We recommend you download it and keep it somewhere safe.",
@@ -327,7 +327,7 @@
"step2-resend-submit": "Resend",
"step2-resend-progress": "Resending...",
"step2-spam-alert": "Make sure to check your spam inbox.",
- "step3-message": "Almost there!",
+ "step3-message": "Create your account",
"step4-message": "Save your Emergency Kit",
"step4-description1": "If you get locked out of your account, your Emergency Kit is the only way to sign in.",
"step4-description2": "We recommend you download it and keep it somewhere safe.",
diff --git a/frontend/src/components/auth/AuthPageLayout.tsx b/frontend/src/components/auth/AuthPageLayout.tsx
index a0a9f19aa4..e05903a280 100644
--- a/frontend/src/components/auth/AuthPageLayout.tsx
+++ b/frontend/src/components/auth/AuthPageLayout.tsx
@@ -9,6 +9,11 @@ import { AuthPageFooter } from "./AuthPageFooter";
import { AuthPageHeader } from "./AuthPageHeader";
type Props = {
+ /** Per-step overrides for the marketing panel copy; the headline stays fixed. */
+ aside?: {
+ eyebrow?: ReactNode;
+ description?: ReactNode;
+ };
bottomContent?: ReactNode;
children: ReactNode;
contentClassName?: string;
@@ -18,6 +23,7 @@ type Props = {
};
export const AuthPageLayout = ({
+ aside,
bottomContent,
children,
contentClassName,
@@ -38,7 +44,7 @@ export const AuthPageLayout = ({
>
<section
className={cn(
- "flex h-screen min-h-0 min-w-0 flex-col overflow-y-auto px-5 sm:px-8 lg:px-10 xl:px-14",
+ "flex h-screen min-h-0 thin-scrollbar min-w-0 flex-col overflow-y-auto px-5 sm:px-8 lg:px-10 xl:px-14",
isSplit && "lg:border-r lg:border-border"
)}
>
@@ -69,7 +75,7 @@ export const AuthPageLayout = ({
<div className="relative z-10 flex flex-1 items-center justify-center px-10 pb-16 xl:px-20">
<div className="max-w-xl">
<p className="mb-4 font-jetbrains-mono text-xs tracking-[0.02em] text-project uppercase">
- Trusted by 400,000+ developers
+ {aside?.eyebrow ?? "Trusted by 400,000+ developers"}
</p>
<h2 className="font-alliance text-3xl leading-tight font-normal text-foreground xl:text-4xl">
<span className="block">
@@ -78,7 +84,8 @@ export const AuthPageLayout = ({
<span className="block">for developers and agents</span>
</h2>
<p className="mt-4 max-w-lg font-alliance text-sm leading-relaxed text-label xl:text-base">
- One place to audit every credential your apps and agents use.
+ {aside?.description ??
+ "One place to audit every credential your apps and agents use."}
</p>
</div>
</div>
diff --git a/frontend/src/components/auth/ProductSelectionStep.tsx b/frontend/src/components/auth/ProductSelectionStep.tsx
new file mode 100644
index 0000000000..7dd5289439
--- /dev/null
+++ b/frontend/src/components/auth/ProductSelectionStep.tsx
@@ -0,0 +1,225 @@
+import { useRef, useState } from "react";
+import { Check } from "lucide-react";
+
+import { createNotification } from "@app/components/notifications";
+import { Button, CardContent, CardDescription, CardHeader, CardTitle } from "@app/components/v3";
+import { cn } from "@app/components/v3/utils";
+import { EXAMPLE_PROJECT_NAME } from "@app/const";
+import { isInfisicalCloud } from "@app/helpers/platform";
+import { initProjectHelper } from "@app/helpers/project";
+import { submitSignupOnboarding } from "@app/hooks/api/auth/queries";
+import { createWorkspace, fetchUserWorkspaces } from "@app/hooks/api/projects/queries";
+import { Project, ProjectType } from "@app/hooks/api/projects/types";
+
+import { AuthPagePanel } from "./AuthPagePanel";
+import {
+ EXPLORING_SELECTION,
+ getSignupProduct,
+ SIGNUP_PRODUCTS,
+ SignupProductSelection,
+ SignupProductType
+} from "./signupProducts";
+
+interface ProductSelectionStepProps {
+ onComplete: (
+ products: SignupProductType[],
+ projects: Partial<Record<SignupProductType, Project>>
+ ) => void;
+}
+
+const setUpProduct = async (product: SignupProductType): Promise<Project | undefined> => {
+ switch (product) {
+ case ProjectType.SecretManager:
+ return initProjectHelper({ projectName: EXAMPLE_PROJECT_NAME });
+ case ProjectType.KMS:
+ case ProjectType.SecretScanning: {
+ const { data } = await createWorkspace({
+ projectName: EXAMPLE_PROJECT_NAME,
+ type: product
+ });
+ return data.project;
+ }
+ case ProjectType.CertificateManager: {
+ // Orgs get a cert-manager project bootstrapped server-side, so locate before creating.
+ const projects = await fetchUserWorkspaces(false, ProjectType.CertificateManager);
+ if (projects.length > 0) return projects[0];
+ const { data } = await createWorkspace({
+ projectName: "Certificate Manager",
+ type: ProjectType.CertificateManager
+ });
+ return data.project;
+ }
+ default:
+ // PAM pages are org-scoped; there is no project to create.
+ return undefined;
+ }
+};
+
+export default function ProductSelectionStep({
+ onComplete
+}: ProductSelectionStepProps): JSX.Element {
+ const [selectedTypes, setSelectedTypes] = useState<SignupProductType[]>([
+ ProjectType.SecretManager
+ ]);
+ const [isExploring, setIsExploring] = useState(false);
+ const [isSettingUp, setIsSettingUp] = useState(false);
+ // Survives failed attempts so a retry only sets up the products still missing.
+ const createdProjectsRef = useRef<Partial<Record<SignupProductType, Project>>>({});
+
+ const toggleProduct = (product: SignupProductType) => {
+ setIsExploring(false);
+ setSelectedTypes((current) =>
+ current.includes(product) ? current.filter((type) => type !== product) : [...current, product]
+ );
+ };
+
+ const selectExploring = () => {
+ setIsExploring(true);
+ setSelectedTypes([]);
+ };
+
+ // Keep the platform's canonical product order regardless of click order.
+ const orderedSelection = SIGNUP_PRODUCTS.filter((product) =>
+ selectedTypes.includes(product.type)
+ ).map((product) => product.type);
+ const canContinue = isExploring || orderedSelection.length > 0;
+
+ const handleContinue = async () => {
+ if (!canContinue || isSettingUp) return;
+
+ setIsSettingUp(true);
+ let failedProduct: string | undefined;
+ try {
+ const projects = createdProjectsRef.current;
+ // Projects are set up one at a time so a failure points at a specific product.
+ // eslint-disable-next-line no-restricted-syntax
+ for (const type of orderedSelection) {
+ if (!(type in projects)) {
+ failedProduct = getSignupProduct(type)?.name;
+ // eslint-disable-next-line no-await-in-loop
+ projects[type] = await setUpProduct(type);
+ }
+ }
+
+ // One summary event for the whole selection, plus one per-product event for breakdowns.
+ submitSignupOnboarding({ selectedProducts: orderedSelection }).catch(() => {});
+ const telemetrySelections: SignupProductSelection[] = isExploring
+ ? [EXPLORING_SELECTION]
+ : orderedSelection;
+ telemetrySelections.forEach((selection) => {
+ submitSignupOnboarding({ selectedProduct: selection }).catch(() => {});
+ if (isInfisicalCloud()) {
+ window.dataLayer = window.dataLayer || [];
+ window.dataLayer.push({ event: "signup_product_selected", product: selection });
+ }
+ });
+
+ onComplete(orderedSelection, { ...projects });
+ } catch {
+ createNotification({
+ type: "error",
+ text: failedProduct
+ ? `Could not set up ${failedProduct}. Please try again.`
+ : "Could not finish setting up your organization. Please try again."
+ });
+ setIsSettingUp(false);
+ }
+ };
+
+ const continueLabel =
+ !isExploring && orderedSelection.length > 0
+ ? `Continue with ${orderedSelection.length} product${orderedSelection.length > 1 ? "s" : ""}`
+ : "Continue";
+
+ return (
+ <div className="mx-auto flex w-full flex-col items-center justify-center">
+ <AuthPagePanel>
+ <CardHeader className="mb-4 gap-2">
+ <CardTitle className="bg-linear-to-b from-white to-bunker-200 bg-clip-text font-alliance text-2xl font-normal text-transparent">
+ What brings you to Infisical?
+ </CardTitle>
+ <CardDescription className="text-sm text-label">
+ Pick everything you&apos;re interested in and we&apos;ll set your organization up around
+ it. You can set up the rest anytime.
+ </CardDescription>
+ </CardHeader>
+ <CardContent className="flex flex-col gap-4">
+ <div role="group" aria-label="Product selection" className="flex flex-col gap-3">
+ {SIGNUP_PRODUCTS.map((product) => {
+ const isSelected = selectedTypes.includes(product.type);
+ const Icon = product.icon;
+
+ return (
+ <button
+ key={product.type}
+ type="button"
+ role="checkbox"
+ aria-checked={isSelected}
+ onClick={() => toggleProduct(product.type)}
+ className={cn(
+ "flex w-full cursor-pointer items-center gap-3.5 rounded-md border bg-container/50 p-4 text-left transition-colors duration-200",
+ isSelected
+ ? product.selectedCardClassName
+ : "border-border hover:bg-container-hover/50"
+ )}
+ >
+ <div className={cn("shrink-0 rounded-sm border p-2", product.tileClassName)}>
+ <Icon className={cn("h-4.5 w-4.5", product.iconClassName)} />
+ </div>
+ <div className="min-w-0 flex-1">
+ <p className="text-sm font-semibold text-foreground">{product.name}</p>
+ <p className="mt-0.5 text-xs leading-snug text-muted">{product.description}</p>
+ </div>
+ <span
+ aria-hidden
+ className={cn(
+ "flex size-5 shrink-0 items-center justify-center rounded-sm border transition-colors duration-200",
+ isSelected
+ ? cn(product.radioClassName, product.dotClassName)
+ : "border-muted/60"
+ )}
+ >
+ {isSelected && <Check className="size-3.5 text-bunker-800" strokeWidth={3} />}
+ </span>
+ </button>
+ );
+ })}
+ <button
+ type="button"
+ role="checkbox"
+ aria-checked={isExploring}
+ onClick={selectExploring}
+ className={cn(
+ "flex w-full cursor-pointer items-center gap-3.5 rounded-md border border-dashed px-4 py-3.5 text-left text-sm transition-colors duration-200",
+ isExploring
+ ? "border-project/50 bg-project/[0.04] text-foreground"
+ : "border-border text-label hover:bg-container-hover/50 hover:text-foreground"
+ )}
+ >
+ <span className="min-w-0 flex-1">I&apos;m just exploring, show me everything</span>
+ <span
+ aria-hidden
+ className={cn(
+ "flex size-5 shrink-0 items-center justify-center rounded-full border transition-colors duration-200",
+ isExploring ? "border-project" : "border-muted/60"
+ )}
+ >
+ {isExploring && <span className="size-2.5 rounded-full bg-project" />}
+ </span>
+ </button>
+ </div>
+ <Button
+ variant="project"
+ size="lg"
+ isFullWidth
+ isDisabled={!canContinue}
+ isPending={isSettingUp}
+ onClick={handleContinue}
+ >
+ {continueLabel}
+ </Button>
+ </CardContent>
+ </AuthPagePanel>
+ </div>
+ );
+}
diff --git a/frontend/src/components/auth/SignupCompleteStep.tsx b/frontend/src/components/auth/SignupCompleteStep.tsx
new file mode 100644
index 0000000000..e43a7749b1
--- /dev/null
+++ b/frontend/src/components/auth/SignupCompleteStep.tsx
@@ -0,0 +1,271 @@
+import { useState } from "react";
+import { useNavigate } from "@tanstack/react-router";
+import { ArrowRight, Info, LayoutGrid } from "lucide-react";
+
+import {
+ Button,
+ CardContent,
+ CardDescription,
+ CardHeader,
+ CardTitle,
+ Separator
+} from "@app/components/v3";
+import { cn } from "@app/components/v3/utils";
+import { getProjectHomePage } from "@app/helpers/project";
+import { submitSignupOnboarding } from "@app/hooks/api/auth/queries";
+import { Project, ProjectType } from "@app/hooks/api/projects/types";
+
+import { AuthPagePanel } from "./AuthPagePanel";
+import { getSignupProduct, SIGNUP_PRODUCTS, SignupProductType } from "./signupProducts";
+
+const ORG_OVERVIEW = "organization-overview" as const;
+
+type LaunchTarget = SignupProductType | typeof ORG_OVERVIEW;
+
+interface SignupCompleteStepProps {
+ orgId: string;
+ products: SignupProductType[];
+ projects: Partial<Record<SignupProductType, Project>>;
+}
+
+const BrandGlyph = ({ viewBox, d }: { viewBox: string; d: string }) => (
+ <svg fill="currentColor" viewBox={viewBox} aria-hidden="true">
+ <path d={d} />
+ </svg>
+);
+
+const COMMUNITY_LINKS = [
+ {
+ label: "Star on GitHub",
+ href: "https://github.com/Infisical/infisical",
+ viewBox: "0 0 496 512",
+ d: "M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"
+ },
+ {
+ label: "Join Slack",
+ href: "https://infisical.com/slack",
+ viewBox: "0 0 448 512",
+ d: "M94.12 315.1c0 25.9-21.16 47.06-47.06 47.06S0 341 0 315.1c0-25.9 21.16-47.06 47.06-47.06h47.06v47.06zm23.72 0c0-25.9 21.16-47.06 47.06-47.06s47.06 21.16 47.06 47.06v117.84c0 25.9-21.16 47.06-47.06 47.06s-47.06-21.16-47.06-47.06V315.1zm47.06-188.98c-25.9 0-47.06-21.16-47.06-47.06S139 32 164.9 32s47.06 21.16 47.06 47.06v47.06H164.9zm0 23.72c25.9 0 47.06 21.16 47.06 47.06s-21.16 47.06-47.06 47.06H47.06C21.16 243.96 0 222.8 0 196.9s21.16-47.06 47.06-47.06H164.9zm188.98 47.06c0-25.9 21.16-47.06 47.06-47.06 25.9 0 47.06 21.16 47.06 47.06s-21.16 47.06-47.06 47.06h-47.06V196.9zm-23.72 0c0 25.9-21.16 47.06-47.06 47.06-25.9 0-47.06-21.16-47.06-47.06V79.06c0-25.9 21.16-47.06 47.06-47.06 25.9 0 47.06 21.16 47.06 47.06V196.9zM283.1 385.88c25.9 0 47.06 21.16 47.06 47.06 0 25.9-21.16 47.06-47.06 47.06-25.9 0-47.06-21.16-47.06-47.06v-47.06h47.06zm0-23.72c-25.9 0-47.06-21.16-47.06-47.06 0-25.9 21.16-47.06 47.06-47.06h117.84c25.9 0 47.06 21.16 47.06 47.06 0 25.9-21.16 47.06-47.06 47.06H283.1z"
+ },
+ {
+ label: "YouTube",
+ href: "https://www.youtube.com/@infisical_os",
+ viewBox: "0 0 24 24",
+ d: "M23.498 6.186a3.016 3.016 0 00-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 00.502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 002.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 002.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"
+ }
+];
+
+const ORG_OVERVIEW_CARD = {
+ name: "Organization Overview",
+ iconClassName: "text-project",
+ tileClassName: "border-project/30 bg-gradient-to-br from-project/20 to-project/5",
+ selectedCardClassName: "border-project/50 bg-project/[0.04]"
+};
+
+export default function SignupCompleteStep({
+ orgId,
+ products,
+ projects
+}: SignupCompleteStepProps): JSX.Element {
+ const navigate = useNavigate();
+ const selectedProducts = SIGNUP_PRODUCTS.filter((product) => products.includes(product.type));
+ const isExploring = selectedProducts.length === 0;
+ const [launchTarget, setLaunchTarget] = useState<LaunchTarget>(products[0] ?? ORG_OVERVIEW);
+
+ const title = (() => {
+ if (isExploring) return "Your organization is ready";
+ if (selectedProducts.length === 1) return `${selectedProducts[0].name} is set up`;
+ return `${selectedProducts.length} products are set up`;
+ })();
+
+ const description = (() => {
+ if (isExploring) {
+ return "We'll drop you on the organization overview so you can explore all five products.";
+ }
+ if (selectedProducts.length === 1) return selectedProducts[0].completedDescription;
+ return "Everything is ready to go.";
+ })();
+
+ const handleOpen = () => {
+ submitSignupOnboarding({ launchDestination: launchTarget }).catch(() => {});
+
+ if (launchTarget !== ORG_OVERVIEW) {
+ if (launchTarget === ProjectType.PAM) {
+ navigate({ to: "/organizations/$orgId/pam/access", params: { orgId } });
+ return;
+ }
+
+ const project = projects[launchTarget];
+ if (project) {
+ navigate({
+ to: getProjectHomePage(project.type, project.environments),
+ params: { orgId, projectId: project.id }
+ });
+ return;
+ }
+ }
+
+ navigate({ to: "/organizations/$orgId/projects", params: { orgId } });
+ };
+
+ return (
+ <div className="mx-auto flex w-full flex-col items-center justify-center">
+ <AuthPagePanel>
+ <CardHeader className="mb-4 gap-2">
+ <p className="font-jetbrains-mono text-xs tracking-[0.02em] text-project uppercase">
+ Organization ready
+ </p>
+ <CardTitle className="bg-linear-to-b from-white to-bunker-200 bg-clip-text font-alliance text-2xl font-normal text-transparent">
+ {title}
+ </CardTitle>
+ <CardDescription className="text-sm text-label">{description}</CardDescription>
+ </CardHeader>
+ <CardContent className="flex flex-col gap-4">
+ {isExploring ? (
+ <div
+ className={cn(
+ "flex items-center gap-3.5 rounded-md border p-4",
+ ORG_OVERVIEW_CARD.selectedCardClassName
+ )}
+ >
+ <div
+ className={cn("shrink-0 rounded-sm border p-2", ORG_OVERVIEW_CARD.tileClassName)}
+ >
+ <LayoutGrid className={cn("h-4.5 w-4.5", ORG_OVERVIEW_CARD.iconClassName)} />
+ </div>
+ <div className="min-w-0 flex-1">
+ <p className="text-sm font-semibold text-foreground">{ORG_OVERVIEW_CARD.name}</p>
+ <p className="mt-0.5 text-sm leading-snug text-label">
+ Your team&apos;s complete security toolkit, organized and ready when you need it.
+ </p>
+ </div>
+ </div>
+ ) : (
+ <div className="flex flex-col gap-2.5">
+ <p className="text-sm font-medium text-foreground">Where would you like to start?</p>
+ <div
+ role="radiogroup"
+ aria-label="Launch destination"
+ className="flex flex-col gap-3"
+ >
+ {selectedProducts.map((product) => {
+ const isSelected = launchTarget === product.type;
+ const Icon = product.icon;
+
+ return (
+ <button
+ key={product.type}
+ type="button"
+ role="radio"
+ aria-checked={isSelected}
+ onClick={() => setLaunchTarget(product.type)}
+ className={cn(
+ "flex w-full cursor-pointer items-center gap-3 rounded-md border bg-container/50 p-3 text-left transition-colors duration-200",
+ isSelected
+ ? product.selectedCardClassName
+ : "border-border hover:bg-container-hover/50"
+ )}
+ >
+ <div
+ className={cn("shrink-0 rounded-sm border p-1.5", product.tileClassName)}
+ >
+ <Icon className={cn("size-4", product.iconClassName)} />
+ </div>
+ <p className="min-w-0 flex-1 text-sm font-medium text-foreground">
+ {product.name}
+ </p>
+ <span
+ aria-hidden
+ className={cn(
+ "flex size-5 shrink-0 items-center justify-center rounded-full border transition-colors duration-200",
+ isSelected ? product.radioClassName : "border-muted/60"
+ )}
+ >
+ {isSelected && (
+ <span className={cn("size-2.5 rounded-full", product.dotClassName)} />
+ )}
+ </span>
+ </button>
+ );
+ })}
+ <div aria-hidden className="flex items-center gap-3">
+ <div className="h-px flex-1 bg-border" />
+ <span className="font-jetbrains-mono text-[10px] tracking-widest text-muted uppercase">
+ or
+ </span>
+ <div className="h-px flex-1 bg-border" />
+ </div>
+ <button
+ type="button"
+ role="radio"
+ aria-checked={launchTarget === ORG_OVERVIEW}
+ onClick={() => setLaunchTarget(ORG_OVERVIEW)}
+ className={cn(
+ "flex w-full cursor-pointer items-center gap-3 rounded-md border border-dashed px-4 py-3.5 text-left text-sm transition-colors duration-200",
+ launchTarget === ORG_OVERVIEW
+ ? "border-project/50 bg-project/[0.04] text-foreground"
+ : "border-border text-label hover:bg-container-hover/50 hover:text-foreground"
+ )}
+ >
+ <LayoutGrid
+ className={cn(
+ "size-4 shrink-0",
+ launchTarget === ORG_OVERVIEW ? "text-project" : "text-muted"
+ )}
+ />
+ <span className="min-w-0 flex-1">
+ Start from the Organization Overview instead
+ </span>
+ <span
+ aria-hidden
+ className={cn(
+ "flex size-5 shrink-0 items-center justify-center rounded-full border transition-colors duration-200",
+ launchTarget === ORG_OVERVIEW ? "border-project" : "border-muted/60"
+ )}
+ >
+ {launchTarget === ORG_OVERVIEW && (
+ <span className="size-2.5 rounded-full bg-project" />
+ )}
+ </span>
+ </button>
+ </div>
+ </div>
+ )}
+ {!isExploring && (
+ <div className="flex items-start gap-2 text-xs text-label">
+ <Info className="mt-0.5 size-3.5 shrink-0 text-muted" />
+ <span>
+ All five products stay available to your organization. Switch to any of them at any
+ time from the{" "}
+ <span className="font-medium text-foreground">Organization Overview</span>.
+ </span>
+ </div>
+ )}
+ <Separator className="my-2" />
+ <div className="flex flex-col gap-1">
+ <p className="text-sm font-semibold text-foreground">While you&apos;re here</p>
+ <p className="text-sm text-label">
+ Star the repo, join the community, and keep up with releases.
+ </p>
+ </div>
+ <div className="flex flex-wrap gap-2">
+ {COMMUNITY_LINKS.map((link) => (
+ <Button key={link.label} asChild variant="outline" size="sm">
+ <a href={link.href} target="_blank" rel="noopener noreferrer">
+ <BrandGlyph viewBox={link.viewBox} d={link.d} />
+ {link.label}
+ </a>
+ </Button>
+ ))}
+ </div>
+ <Button variant="project" size="lg" isFullWidth onClick={handleOpen}>
+ {launchTarget === ORG_OVERVIEW
+ ? "Go to Organization Overview"
+ : `Open ${getSignupProduct(launchTarget)?.name}`}
+ <ArrowRight />
+ </Button>
+ </CardContent>
+ </AuthPagePanel>
+ </div>
+ );
+}
diff --git a/frontend/src/components/auth/TeamInviteStep.tsx b/frontend/src/components/auth/TeamInviteStep.tsx
index 9836e25387..2c704e03b5 100644
--- a/frontend/src/components/auth/TeamInviteStep.tsx
+++ b/frontend/src/components/auth/TeamInviteStep.tsx
@@ -1,31 +1,47 @@
import { useState } from "react";
import { useTranslation } from "react-i18next";
-import { useNavigate } from "@tanstack/react-router";
import { z } from "zod";
import {
Button,
CardContent,
+ CardDescription,
CardHeader,
CardTitle,
Field,
+ FieldDescription,
FieldError,
+ FieldLabel,
+ Input,
+ Separator,
TextArea
} from "@app/components/v3";
import { useAddUsersToOrg } from "@app/hooks/api";
+import { submitSignupOnboarding } from "@app/hooks/api/auth/queries";
import { useFetchServerStatus } from "@app/hooks/api/serverDetails";
import { usePopUp } from "@app/hooks/usePopUp";
import { EmailServiceSetupModal } from "../v2";
import { AuthPagePanel } from "./AuthPagePanel";
-/**
- * This is the last step of the signup flow. People can optionally invite their teammates here.
- */
-export default function TeamInviteStep(): JSX.Element {
+interface TeamInviteStepProps {
+ productName?: string;
+ /** Signup-created projects the invitees get member access to. */
+ projectIds?: string[];
+ /** Also grant access to the org's PAM product (org-scoped, no project id). */
+ grantPamAccess?: boolean;
+ onComplete: () => void;
+}
+
+export default function TeamInviteStep({
+ productName,
+ projectIds,
+ grantPamAccess,
+ onComplete
+}: TeamInviteStepProps): JSX.Element {
const { t } = useTranslation();
- const navigate = useNavigate();
const [emails, setEmails] = useState("");
+ const [attributionSource, setAttributionSource] = useState("");
const [validationError, setValidationError] = useState("");
const { data: serverDetails } = useFetchServerStatus();
@@ -33,23 +49,24 @@ export default function TeamInviteStep(): JSX.Element {
const { handlePopUpToggle, popUp, handlePopUpOpen } = usePopUp(["setUpEmail"] as const);
const orgId = String(localStorage.getItem("orgData.id"));
+ const grantCount = (projectIds?.length ?? 0) + (grantPamAccess ? 1 : 0);
- // Redirect user to the getting started page
- const redirectToHome = async () => {
- navigate({
- to: orgId ? ("/organizations/$orgId/projects" as const) : "/",
- params: { orgId }
- });
+ const finishStep = () => {
+ const trimmedAttribution = attributionSource.trim();
+ if (trimmedAttribution) {
+ submitSignupOnboarding({ attributionSource: trimmedAttribution }).catch(() => {});
+ }
+ onComplete();
};
- const inviteUsers = async ({ emails: inviteEmails }: { emails: string }) => {
- const parsed = inviteEmails
+ const inviteUsersAndContinue = async () => {
+ const parsed = emails
.split(",")
.map((email) => email.trim())
.filter(Boolean);
if (parsed.length === 0) {
- setValidationError("Please enter at least one email address.");
+ setValidationError("Please enter at least one email address, or skip for now.");
return;
}
@@ -61,17 +78,20 @@ export default function TeamInviteStep(): JSX.Element {
setValidationError("");
- await Promise.all(
- parsed.map((email) =>
- mutateAsync({
- inviteeEmails: [email],
- organizationId: orgId,
- organizationRoleSlug: "member"
- })
- )
- );
+ try {
+ await mutateAsync({
+ inviteeEmails: parsed,
+ organizationId: orgId,
+ organizationRoleSlug: "member",
+ ...(projectIds?.length ? { projectIds } : {}),
+ ...(grantPamAccess ? { grantPamAccess } : {})
+ });
+ } catch {
+ // The global mutation error handler already surfaces a toast; stay on this step.
+ return;
+ }
- await redirectToHome();
+ finishStep();
};
return (
@@ -81,6 +101,9 @@ export default function TeamInviteStep(): JSX.Element {
<CardTitle className="bg-linear-to-b from-white to-bunker-200 bg-clip-text font-alliance text-2xl font-normal text-transparent">
{t("signup.step5-invite-team")}
</CardTitle>
+ <CardDescription className="text-sm text-label">
+ Bring in the people who&apos;ll work with {productName ?? "Infisical"} day to day.
+ </CardDescription>
</CardHeader>
<CardContent className="flex flex-col gap-4">
<Field data-invalid={Boolean(validationError)}>
@@ -95,12 +118,32 @@ export default function TeamInviteStep(): JSX.Element {
isError={Boolean(validationError)}
/>
{validationError && <FieldError>{validationError}</FieldError>}
+ {grantCount > 0 && (
+ <FieldDescription>
+ They&apos;ll join your organization and get access to the{" "}
+ {grantCount > 1 ? "products" : "product"} you just set up.
+ </FieldDescription>
+ )}
+ </Field>
+ <Separator />
+ <Field>
+ <FieldLabel htmlFor="signup-attribution-source">
+ Where did you hear about us?{" "}
+ <span className="font-normal text-muted">(optional)</span>
+ </FieldLabel>
+ <Input
+ id="signup-attribution-source"
+ value={attributionSource}
+ onChange={(e) => setAttributionSource(e.target.value)}
+ placeholder="e.g. Hacker News, a friend, GitHub..."
+ maxLength={512}
+ />
</Field>
<div className="flex flex-col gap-2">
<Button
onClick={() => {
if (serverDetails?.emailConfigured) {
- inviteUsers({ emails });
+ inviteUsersAndContinue();
} else {
handlePopUpOpen("setUpEmail");
}
@@ -110,16 +153,16 @@ export default function TeamInviteStep(): JSX.Element {
isFullWidth
isPending={isPending}
>
- {t("signup.step5-send-invites") ?? ""}
+ Send Invites & Continue
</Button>
<Button
- onClick={redirectToHome}
+ onClick={finishStep}
isDisabled={isPending}
- variant="outline"
+ variant="ghost"
size="lg"
isFullWidth
>
- {t("signup.step5-skip") ?? "Skip"}
+ Skip for Now
</Button>
</div>
</CardContent>
diff --git a/frontend/src/components/auth/UserInfoStep.tsx b/frontend/src/components/auth/UserInfoStep.tsx
index 69238caf92..8bbc12f8f8 100644
--- a/frontend/src/components/auth/UserInfoStep.tsx
+++ b/frontend/src/components/auth/UserInfoStep.tsx
@@ -1,5 +1,5 @@
import { useState } from "react";
-import { SubmitErrorHandler, useForm } from "react-hook-form";
+import { useForm } from "react-hook-form";
import { useTranslation } from "react-i18next";
import { zodResolver } from "@hookform/resolvers/zod";
import { Check, Eye, EyeOff, X } from "lucide-react";
@@ -21,13 +21,10 @@ import {
InputGroup,
InputGroupAddon,
InputGroupButton,
- InputGroupInput,
- TextArea
+ InputGroupInput
} from "@app/components/v3";
-import { EXAMPLE_PROJECT_NAME } from "@app/const";
import { useServerConfig } from "@app/context";
import { isInfisicalCloud } from "@app/helpers/platform";
-import { initProjectHelper } from "@app/helpers/project";
import { getHubSpotUtk } from "@app/helpers/utmTracking";
import { TPasswordPolicy } from "@app/hooks/api/admin/types";
import { useCompleteAccountSignup } from "@app/hooks/api/auth/queries";
@@ -44,8 +41,7 @@ const createUserInfoFormSchema = (isInvite: boolean, passwordPolicy: TPasswordPo
lastName: z.string().trim().optional(),
organizationName: isInvite ? z.string().optional() : GenericResourceNameSchema,
password: createPasswordSchema(passwordPolicy),
- confirmPassword: z.string().min(1, "Please confirm your password"),
- attributionSource: z.string().optional()
+ confirmPassword: z.string().min(1, "Please confirm your password")
})
.refine(({ password, confirmPassword }) => password === confirmPassword, {
message: "Passwords do not match",
@@ -55,7 +51,7 @@ const createUserInfoFormSchema = (isInvite: boolean, passwordPolicy: TPasswordPo
type UserInfoFormData = z.infer<ReturnType<typeof createUserInfoFormSchema>>;
interface UserInfoStepProps {
- onComplete: () => void;
+ onComplete: (orgId?: string) => void;
email: string;
isInvite?: boolean;
}
@@ -66,7 +62,6 @@ export default function UserInfoStep({
isInvite = false
}: UserInfoStepProps): JSX.Element {
const [showConfirmPassword, setShowConfirmPassword] = useState(false);
- const [isAttributionStep, setIsAttributionStep] = useState(false);
const { config } = useServerConfig();
const { mutateAsync: completeSignup, isPending: isLoading } = useCompleteAccountSignup();
@@ -86,8 +81,7 @@ export default function UserInfoStep({
lastName: "",
organizationName: "",
password: "",
- confirmPassword: "",
- attributionSource: ""
+ confirmPassword: ""
}
});
@@ -105,10 +99,8 @@ export default function UserInfoStep({
const isPasswordValidated =
passwordBreachStatus === "safe" || passwordBreachStatus === "unavailable";
const canSubmit = isPasswordValidated && !isLoading;
- const accountStepTitle = isInvite ? "Set up your account" : t("signup.step3-message");
- const stepTitle = isAttributionStep ? "We'd love to know..." : accountStepTitle;
- // Submit label defaults to "Next" for the standard flow; the invite flow overrides it to "Sign Up".
- const submitLabel = isInvite ? t("signup.signup") : t("signup.next");
+ const stepTitle = isInvite ? "Set up your account" : t("signup.step3-message");
+ const submitLabel = isInvite ? String(t("signup.signup")) : "Continue";
const onSubmit = async (formData: UserInfoFormData) => {
const latestBreachStatus = await validatePassword(formData.password);
@@ -127,7 +119,6 @@ export default function UserInfoStep({
firstName: formData.firstName,
lastName: formData.lastName ?? "",
organizationName: formData.organizationName || undefined,
- attributionSource: formData.attributionSource,
hubspotUtk: getHubSpotUtk()
});
@@ -142,23 +133,11 @@ export default function UserInfoStep({
const userOrgs = await fetchOrganizations();
const orgId = userOrgs[0]?.id;
- if (!isInvite) {
- await initProjectHelper({
- projectName: EXAMPLE_PROJECT_NAME
- });
- }
-
if (orgId) {
localStorage.setItem("orgData.id", orgId);
}
- onComplete();
- };
-
- const onInvalidSubmit: SubmitErrorHandler<UserInfoFormData> = (formErrors) => {
- if (formErrors.organizationName) {
- setIsAttributionStep(false);
- }
+ onComplete(orgId);
};
return (
@@ -170,175 +149,122 @@ export default function UserInfoStep({
</CardTitle>
</CardHeader>
<CardContent className="flex flex-col gap-4">
- {!isAttributionStep && (
- <>
- <div className="grid grid-cols-1 gap-4 sm:grid-cols-2">
- <Field data-invalid={showDangerState && Boolean(errors.firstName)}>
- <FieldLabel className="sr-only" htmlFor="signup-first-name">
- First Name
- </FieldLabel>
- <Input
- {...register("firstName")}
- id="signup-first-name"
- placeholder="First Name"
- autoComplete="given-name"
- isError={showDangerState && Boolean(errors.firstName)}
- />
- {showDangerState && errors.firstName ? (
- <FieldError>{errors.firstName.message}</FieldError>
- ) : null}
- </Field>
- <Field data-invalid={showDangerState && Boolean(errors.lastName)}>
- <FieldLabel className="sr-only" htmlFor="signup-last-name">
- Last Name
- </FieldLabel>
- <Input
- {...register("lastName")}
- id="signup-last-name"
- placeholder="Last Name"
- autoComplete="family-name"
- isError={showDangerState && Boolean(errors.lastName)}
- />
- {showDangerState && errors.lastName ? (
- <FieldError>{errors.lastName.message}</FieldError>
- ) : null}
- </Field>
- </div>
- {!isInvite && (
- <Field data-invalid={showOrganizationNameError}>
- <FieldLabel className="sr-only" htmlFor="signup-organization-name">
- Organization Name
- </FieldLabel>
- <Input
- {...register("organizationName")}
- id="signup-organization-name"
- placeholder="Organization Name"
- maxLength={64}
- autoComplete="organization"
- isError={showOrganizationNameError}
- />
- {showOrganizationNameError && errors.organizationName ? (
- <FieldError>{errors.organizationName.message}</FieldError>
- ) : null}
- </Field>
- )}
- <PasswordField
- id="new-password"
- value={passwordValue}
- policy={config.passwordPolicy}
- breachStatus={passwordBreachStatus}
- placeholder="••••••••"
- registration={register("password")}
- error={showDangerState ? errors.password : undefined}
- submitCount={submitCount}
+ <div className="grid grid-cols-1 gap-4 sm:grid-cols-2">
+ <Field data-invalid={showDangerState && Boolean(errors.firstName)}>
+ <FieldLabel className="sr-only" htmlFor="signup-first-name">
+ First Name
+ </FieldLabel>
+ <Input
+ {...register("firstName")}
+ id="signup-first-name"
+ placeholder="First Name"
+ autoComplete="given-name"
+ isError={showDangerState && Boolean(errors.firstName)}
/>
- <AnimatedCollapse
- isOpen={isPasswordValidated}
- contentClassName={isPasswordValidated ? "overflow-visible" : undefined}
- >
- <Field data-invalid={showDangerState && Boolean(errors.confirmPassword)}>
- <FieldLabel htmlFor="confirm-password">Confirm Password</FieldLabel>
- <InputGroup>
- <InputGroupInput
- {...register("confirmPassword")}
- id="confirm-password"
- type={showConfirmPassword ? "text" : "password"}
- placeholder="••••••••"
- autoComplete="new-password"
- aria-invalid={showDangerState && Boolean(errors.confirmPassword)}
- />
- <InputGroupAddon align="inline-end">
- <InputGroupButton
- onClick={() => setShowConfirmPassword((current) => !current)}
- aria-label={
- showConfirmPassword
- ? "Hide password confirmation"
- : "Show password confirmation"
- }
- >
- {showConfirmPassword ? <EyeOff /> : <Eye />}
- </InputGroupButton>
- </InputGroupAddon>
- </InputGroup>
- <AnimatedCollapse isOpen={confirmPasswordValue.length > 0}>
- <div className="flex items-start gap-2 pt-1 text-xs" aria-live="polite">
- {doPasswordsMatch ? (
- <Check className="mt-0.5 size-3.5 shrink-0 text-success" />
- ) : (
- <X className="mt-0.5 size-3.5 shrink-0 text-danger" />
- )}
- <span className={doPasswordsMatch ? "text-muted" : "text-danger"}>
- {doPasswordsMatch ? "Passwords match" : "Passwords do not match"}
- </span>
- </div>
- </AnimatedCollapse>
- {showDangerState && errors.confirmPassword ? (
- <FieldError>{errors.confirmPassword.message}</FieldError>
- ) : null}
- </Field>
- </AnimatedCollapse>
- {isInvite ? (
- <Button
- type="submit"
- onClick={handleSubmit(onSubmit)}
- variant="project"
- size="lg"
- isFullWidth
- isPending={isLoading}
- isDisabled={!canSubmit}
- >
- {String(submitLabel)}
- </Button>
- ) : (
- <Button
- variant="project"
- size="lg"
- isFullWidth
- isDisabled={!canSubmit}
- onClick={handleSubmit(() => setIsAttributionStep(true))}
- >
- Continue
- </Button>
- )}
- </>
+ {showDangerState && errors.firstName ? (
+ <FieldError>{errors.firstName.message}</FieldError>
+ ) : null}
+ </Field>
+ <Field data-invalid={showDangerState && Boolean(errors.lastName)}>
+ <FieldLabel className="sr-only" htmlFor="signup-last-name">
+ Last Name
+ </FieldLabel>
+ <Input
+ {...register("lastName")}
+ id="signup-last-name"
+ placeholder="Last Name"
+ autoComplete="family-name"
+ isError={showDangerState && Boolean(errors.lastName)}
+ />
+ {showDangerState && errors.lastName ? (
+ <FieldError>{errors.lastName.message}</FieldError>
+ ) : null}
+ </Field>
+ </div>
+ {!isInvite && (
+ <Field data-invalid={showOrganizationNameError}>
+ <FieldLabel className="sr-only" htmlFor="signup-organization-name">
+ Organization Name
+ </FieldLabel>
+ <Input
+ {...register("organizationName")}
+ id="signup-organization-name"
+ placeholder="Organization Name"
+ maxLength={64}
+ autoComplete="organization"
+ isError={showOrganizationNameError}
+ />
+ {showOrganizationNameError && errors.organizationName ? (
+ <FieldError>{errors.organizationName.message}</FieldError>
+ ) : null}
+ </Field>
)}
- {isAttributionStep && (
- <>
- <Field>
- <FieldLabel className="sr-only" htmlFor="signup-attribution-source">
- Where did you hear about us? <span className="font-light">(optional)</span>
- </FieldLabel>
- <TextArea
- {...register("attributionSource")}
- id="signup-attribution-source"
- placeholder="Where did you hear about us? (optional)"
- rows={3}
- autoFocus
+ <PasswordField
+ id="new-password"
+ value={passwordValue}
+ policy={config.passwordPolicy}
+ breachStatus={passwordBreachStatus}
+ placeholder="••••••••"
+ registration={register("password")}
+ error={showDangerState ? errors.password : undefined}
+ submitCount={submitCount}
+ />
+ <AnimatedCollapse
+ isOpen={isPasswordValidated}
+ contentClassName={isPasswordValidated ? "overflow-visible" : undefined}
+ >
+ <Field data-invalid={showDangerState && Boolean(errors.confirmPassword)}>
+ <FieldLabel htmlFor="confirm-password">Confirm Password</FieldLabel>
+ <InputGroup>
+ <InputGroupInput
+ {...register("confirmPassword")}
+ id="confirm-password"
+ type={showConfirmPassword ? "text" : "password"}
+ placeholder="••••••••"
+ autoComplete="new-password"
+ aria-invalid={showDangerState && Boolean(errors.confirmPassword)}
/>
- </Field>
- <div className="flex flex-col gap-2">
- <Button
- type="submit"
- onClick={handleSubmit(onSubmit, onInvalidSubmit)}
- variant="project"
- size="lg"
- isFullWidth
- isPending={isLoading}
- isDisabled={!canSubmit}
- >
- {String(submitLabel)}
- </Button>
- <Button
- variant="outline"
- size="lg"
- isFullWidth
- onClick={() => setIsAttributionStep(false)}
- >
- Back
- </Button>
- </div>
- </>
- )}
+ <InputGroupAddon align="inline-end">
+ <InputGroupButton
+ onClick={() => setShowConfirmPassword((current) => !current)}
+ aria-label={
+ showConfirmPassword
+ ? "Hide password confirmation"
+ : "Show password confirmation"
+ }
+ >
+ {showConfirmPassword ? <EyeOff /> : <Eye />}
+ </InputGroupButton>
+ </InputGroupAddon>
+ </InputGroup>
+ <AnimatedCollapse isOpen={confirmPasswordValue.length > 0}>
+ <div className="flex items-start gap-2 pt-1 text-xs" aria-live="polite">
+ {doPasswordsMatch ? (
+ <Check className="mt-0.5 size-3.5 shrink-0 text-success" />
+ ) : (
+ <X className="mt-0.5 size-3.5 shrink-0 text-danger" />
+ )}
+ <span className={doPasswordsMatch ? "text-muted" : "text-danger"}>
+ {doPasswordsMatch ? "Passwords match" : "Passwords do not match"}
+ </span>
+ </div>
+ </AnimatedCollapse>
+ {showDangerState && errors.confirmPassword ? (
+ <FieldError>{errors.confirmPassword.message}</FieldError>
+ ) : null}
+ </Field>
+ </AnimatedCollapse>
+ <Button
+ type="submit"
+ onClick={handleSubmit(onSubmit)}
+ variant="project"
+ size="lg"
+ isFullWidth
+ isPending={isLoading}
+ isDisabled={!canSubmit}
+ >
+ {submitLabel}
+ </Button>
</CardContent>
</AuthPagePanel>
</div>
diff --git a/frontend/src/components/auth/signupProducts.ts b/frontend/src/components/auth/signupProducts.ts
new file mode 100644
index 0000000000..4d6041874f
--- /dev/null
+++ b/frontend/src/components/auth/signupProducts.ts
@@ -0,0 +1,98 @@
+import { LucideIcon } from "lucide-react";
+
+import { getProjectLucideIcon } from "@app/helpers/project";
+import { ProjectType } from "@app/hooks/api/projects/types";
+
+export type SignupProductType =
+ | ProjectType.SecretManager
+ | ProjectType.CertificateManager
+ | ProjectType.KMS
+ | ProjectType.PAM
+ | ProjectType.SecretScanning;
+
+export const EXPLORING_SELECTION = "exploring" as const;
+
+export type SignupProductSelection = SignupProductType | typeof EXPLORING_SELECTION;
+
+export type SignupProductMeta = {
+ type: SignupProductType;
+ name: string;
+ description: string;
+ /** Summary-page subline. PKI and PAM are single-instance, so their copy must not mention projects. */
+ completedDescription: string;
+ icon: LucideIcon;
+ // Class strings are written out per product (not interpolated) so Tailwind's scanner emits them.
+ iconClassName: string;
+ tileClassName: string;
+ selectedCardClassName: string;
+ radioClassName: string;
+ dotClassName: string;
+};
+
+export const SIGNUP_PRODUCTS: SignupProductMeta[] = [
+ {
+ type: ProjectType.SecretManager,
+ name: "Secrets Management",
+ description:
+ "Centralize secrets across environments with syncs, rotation, and dynamic credentials.",
+ completedDescription: "Your first project is created. Jump in and add your first resources.",
+ icon: getProjectLucideIcon(ProjectType.SecretManager),
+ iconClassName: "text-product-sm",
+ tileClassName: "border-product-sm/30 bg-gradient-to-br from-product-sm/20 to-product-sm/5",
+ selectedCardClassName: "border-product-sm/50 bg-product-sm/[0.04]",
+ radioClassName: "border-product-sm",
+ dotClassName: "bg-product-sm"
+ },
+ {
+ type: ProjectType.CertificateManager,
+ name: "Certificate Management (PKI)",
+ description: "Issue, rotate, and govern X.509 certificates for TLS, mTLS, and code signing.",
+ completedDescription: "Everything is ready. Jump in and issue your first certificates.",
+ icon: getProjectLucideIcon(ProjectType.CertificateManager),
+ iconClassName: "text-product-pki",
+ tileClassName: "border-product-pki/30 bg-gradient-to-br from-product-pki/20 to-product-pki/5",
+ selectedCardClassName: "border-product-pki/50 bg-product-pki/[0.04]",
+ radioClassName: "border-product-pki",
+ dotClassName: "bg-product-pki"
+ },
+ {
+ type: ProjectType.KMS,
+ name: "KMS",
+ description: "Generate, store, and use cryptographic keys to encrypt, sign, and verify.",
+ completedDescription: "Your first project is created. Jump in and add your first resources.",
+ icon: getProjectLucideIcon(ProjectType.KMS),
+ iconClassName: "text-product-kms",
+ tileClassName: "border-product-kms/30 bg-gradient-to-br from-product-kms/20 to-product-kms/5",
+ selectedCardClassName: "border-product-kms/50 bg-product-kms/[0.04]",
+ radioClassName: "border-product-kms",
+ dotClassName: "bg-product-kms"
+ },
+ {
+ type: ProjectType.PAM,
+ name: "Privileged Access Management",
+ description: "Secure access to databases and servers with session brokering and recording.",
+ completedDescription: "Everything is ready. Jump in and connect your first resources.",
+ icon: getProjectLucideIcon(ProjectType.PAM),
+ iconClassName: "text-product-pam",
+ tileClassName: "border-product-pam/30 bg-gradient-to-br from-product-pam/20 to-product-pam/5",
+ selectedCardClassName: "border-product-pam/50 bg-product-pam/[0.04]",
+ radioClassName: "border-product-pam",
+ dotClassName: "bg-product-pam"
+ },
+ {
+ type: ProjectType.SecretScanning,
+ name: "Secret Scanning",
+ description: "Continuously scan repos, builds, and artifacts for leaked secrets.",
+ completedDescription: "Your first project is created. Jump in and add your first resources.",
+ icon: getProjectLucideIcon(ProjectType.SecretScanning),
+ iconClassName: "text-product-ss",
+ tileClassName: "border-product-ss/30 bg-gradient-to-br from-product-ss/20 to-product-ss/5",
+ selectedCardClassName: "border-product-ss/50 bg-product-ss/[0.04]",
+ radioClassName: "border-product-ss",
+ dotClassName: "bg-product-ss"
+ }
+];
+
+export const getSignupProduct = (
+ selection: SignupProductSelection | null | undefined
+): SignupProductMeta | undefined => SIGNUP_PRODUCTS.find((product) => product.type === selection);
diff --git a/frontend/src/helpers/project.ts b/frontend/src/helpers/project.ts
index 8fe48fab2d..50b0050154 100644
--- a/frontend/src/helpers/project.ts
+++ b/frontend/src/helpers/project.ts
@@ -52,13 +52,12 @@ export const initProjectHelper = async ({ projectName }: { projectName: string }
});
try {
- const { data } = await apiRequest.post("/api/v4/secrets/batch", {
+ await apiRequest.post("/api/v4/secrets/batch", {
projectId: project.id,
environment: "dev",
secretPath: "/",
secrets: secretsToBeAdded
});
- return data;
} catch (err) {
console.error("Failed to upload secrets", err);
}
diff --git a/frontend/src/hooks/api/auth/queries.tsx b/frontend/src/hooks/api/auth/queries.tsx
index 3895f07d5f..01bb2bfe45 100644
--- a/frontend/src/hooks/api/auth/queries.tsx
+++ b/frontend/src/hooks/api/auth/queries.tsx
@@ -27,6 +27,7 @@ import {
ResetUserPasswordV2DTO,
SendMfaTokenDTO,
SetupPasswordDTO,
+ SignupOnboardingDTO,
TOauthTokenExchangeDTO,
UserAgentType,
VerifyMfaTokenDTO,
@@ -146,6 +147,12 @@ export const useCompleteAccountSignup = () => {
});
};
+/** Fire-and-forget onboarding telemetry; callers must never block the signup flow on it. */
+export const submitSignupOnboarding = async (details: SignupOnboardingDTO) => {
+ const { data } = await apiRequest.post("/api/v3/signup/onboarding", details);
+ return data;
+};
+
export const useSendMfaToken = () => {
return useMutation<object, object, SendMfaTokenDTO>({
mutationFn: async ({ email }) => {
diff --git a/frontend/src/hooks/api/auth/types.ts b/frontend/src/hooks/api/auth/types.ts
index d73f9edd14..02efae4d6d 100644
--- a/frontend/src/hooks/api/auth/types.ts
+++ b/frontend/src/hooks/api/auth/types.ts
@@ -113,6 +113,26 @@ export type CompleteAccountSignupDTO =
hubspotUtk?: string;
};
+export type SignupOnboardingDTO = {
+ selectedProduct?:
+ | "secret-manager"
+ | "cert-manager"
+ | "kms"
+ | "secret-scanning"
+ | "pam"
+ | "exploring";
+ /** An empty array means "just exploring". */
+ selectedProducts?: ("secret-manager" | "cert-manager" | "kms" | "secret-scanning" | "pam")[];
+ launchDestination?:
+ | "secret-manager"
+ | "cert-manager"
+ | "kms"
+ | "secret-scanning"
+ | "pam"
+ | "organization-overview";
+ attributionSource?: string;
+};
+
export type VerifySignupInviteDTO = {
email: string;
code: string;
diff --git a/frontend/src/hooks/api/projects/queries.tsx b/frontend/src/hooks/api/projects/queries.tsx
index 45b043d96b..59d08c9a24 100644
--- a/frontend/src/hooks/api/projects/queries.tsx
+++ b/frontend/src/hooks/api/projects/queries.tsx
@@ -98,7 +98,7 @@ export const useGetUpgradeProjectStatus = ({
});
};
-const fetchUserWorkspaces = async (includeRoles?: boolean, type?: ProjectType | "all") => {
+export const fetchUserWorkspaces = async (includeRoles?: boolean, type?: ProjectType | "all") => {
const { data } = await apiRequest.get<{ projects: Project[] }>("/api/v1/projects", {
params: {
includeRoles,
diff --git a/frontend/src/hooks/api/users/types.ts b/frontend/src/hooks/api/users/types.ts
index edf3cc7cad..dccc5b26a3 100644
--- a/frontend/src/hooks/api/users/types.ts
+++ b/frontend/src/hooks/api/users/types.ts
@@ -180,6 +180,10 @@ export type AddUserToOrgDTO = {
inviteeEmails: string[];
organizationRoleSlug: string;
organizationId: string;
+ /** Signup-created projects the invitees get member access to. */
+ projectIds?: string[];
+ /** Also grant invitees member access to the org's PAM product. */
+ grantPamAccess?: boolean;
};
export type CreateAPIKeyRes = {
diff --git a/frontend/src/pages/auth/SignUpPage/SignUpPage.tsx b/frontend/src/pages/auth/SignUpPage/SignUpPage.tsx
index 5c4ef35172..7f06faaf3d 100644
--- a/frontend/src/pages/auth/SignUpPage/SignUpPage.tsx
+++ b/frontend/src/pages/auth/SignUpPage/SignUpPage.tsx
@@ -6,21 +6,36 @@ import { Link, useNavigate } from "@tanstack/react-router";
import { AuthPageLayout } from "@app/components/auth/AuthPageLayout";
import CodeInputStep from "@app/components/auth/CodeInputStep";
import InitialSignupStep from "@app/components/auth/InitialSignupStep";
+import ProductSelectionStep from "@app/components/auth/ProductSelectionStep";
+import SignupCompleteStep from "@app/components/auth/SignupCompleteStep";
+import { getSignupProduct, SignupProductType } from "@app/components/auth/signupProducts";
import TeamInviteStep from "@app/components/auth/TeamInviteStep";
import UserInfoStep from "@app/components/auth/UserInfoStep";
import { createNotification } from "@app/components/notifications";
import { useServerConfig } from "@app/context";
import { useSelectOrganization } from "@app/hooks/api/auth/queries";
import { fetchOrganizations } from "@app/hooks/api/organization/queries";
+import { Project, ProjectType } from "@app/hooks/api/projects/types";
import { useFetchServerStatus } from "@app/hooks/api/serverDetails";
enum SignupSection {
Email = "email",
VerifyCode = "verify-code",
UserInfo = "user-info",
- InviteTeam = "invite-team"
+ ProductSelect = "product-select",
+ InviteTeam = "invite-team",
+ Complete = "complete"
}
+// Email entry and code verification share a step; the completion summary shows no counter.
+const STEP_NUMBERS: Partial<Record<SignupSection, number>> = {
+ [SignupSection.Email]: 1,
+ [SignupSection.VerifyCode]: 1,
+ [SignupSection.UserInfo]: 2,
+ [SignupSection.ProductSelect]: 3,
+ [SignupSection.InviteTeam]: 4
+};
+
type PendingEmailVerification = {
email: string;
resendCooldownEndTime: number;
@@ -40,6 +55,12 @@ export const SignUpPage = ({ invite }: SignUpPageProps) => {
const [section, setSection] = useState<SignupSection>(
isInvite ? SignupSection.UserInfo : SignupSection.Email
);
+ const [orgId, setOrgId] = useState("");
+ // An empty selection means "just exploring".
+ const [selectedProducts, setSelectedProducts] = useState<SignupProductType[]>([]);
+ const [createdProjects, setCreatedProjects] = useState<
+ Partial<Record<SignupProductType, Project>>
+ >({});
const navigate = useNavigate();
const { data: serverDetails } = useFetchServerStatus();
const { t } = useTranslation();
@@ -90,34 +111,50 @@ export const SignUpPage = ({ invite }: SignUpPageProps) => {
);
};
- const handleUserInfoComplete = async () => {
+ const handleUserInfoComplete = async (newOrgId?: string) => {
if (isInvite) {
const userOrgs = await fetchOrganizations();
- const orgId = userOrgs[0]?.id;
+ const inviteOrgId = userOrgs[0]?.id;
- if (orgId) {
- const { isMfaEnabled } = await selectOrganization({ organizationId: orgId });
+ if (inviteOrgId) {
+ const { isMfaEnabled } = await selectOrganization({ organizationId: inviteOrgId });
if (isMfaEnabled) {
navigate({
to: "/login/select-organization",
- search: { org_id: orgId }
+ search: { org_id: inviteOrgId }
});
return;
}
navigate({
to: "/organizations/$orgId/projects",
- params: { orgId }
+ params: { orgId: inviteOrgId }
});
} else {
navigate({ to: "/login" });
}
- } else if (serverDetails?.emailConfigured) {
- setSection(SignupSection.InviteTeam);
- } else {
- navigate({ to: "/" });
+ return;
}
+
+ if (newOrgId) {
+ setOrgId(newOrgId);
+ }
+ setSection(SignupSection.ProductSelect);
+ };
+
+ const handleProductSelectComplete = (
+ products: SignupProductType[],
+ projects: Partial<Record<SignupProductType, Project>>
+ ) => {
+ setSelectedProducts(products);
+ setCreatedProjects(projects);
+ // The invite step needs a working email service; skip straight to the summary without one.
+ setSection(serverDetails?.emailConfigured ? SignupSection.InviteTeam : SignupSection.Complete);
+ };
+
+ const handleInviteComplete = () => {
+ setSection(SignupSection.Complete);
};
const renderView = () => {
@@ -146,38 +183,68 @@ export const SignUpPage = ({ invite }: SignUpPageProps) => {
return (
<UserInfoStep onComplete={handleUserInfoComplete} email={email} isInvite={isInvite} />
);
+ case SignupSection.ProductSelect:
+ return <ProductSelectionStep onComplete={handleProductSelectComplete} />;
case SignupSection.InviteTeam:
- return <TeamInviteStep />;
+ return (
+ <TeamInviteStep
+ productName={
+ selectedProducts.length === 1
+ ? getSignupProduct(selectedProducts[0])?.name
+ : undefined
+ }
+ projectIds={Object.values(createdProjects).flatMap((project) =>
+ project ? [project.id] : []
+ )}
+ grantPamAccess={selectedProducts.includes(ProjectType.PAM)}
+ onComplete={handleInviteComplete}
+ />
+ );
+ case SignupSection.Complete:
+ return (
+ <SignupCompleteStep
+ orgId={orgId || (localStorage.getItem("orgData.id") ?? "")}
+ products={selectedProducts}
+ projects={createdProjects}
+ />
+ );
default:
return null;
}
};
+ const termsNotice = (
+ <p className="text-xs text-pretty text-label">
+ By signing up, you agree to our{" "}
+ <a
+ href="https://infisical.com/terms/cloud"
+ target="_blank"
+ rel="noopener noreferrer"
+ className="underline underline-offset-2 transition-colors duration-200 hover:text-foreground hover:decoration-project/45"
+ >
+ Terms of Service
+ </a>{" "}
+ and{" "}
+ <a
+ href="https://infisical.com/privacy"
+ target="_blank"
+ rel="noopener noreferrer"
+ className="underline underline-offset-2 transition-colors duration-200 hover:text-foreground hover:decoration-project/45"
+ >
+ Privacy Policy
+ </a>
+ .
+ </p>
+ );
+
const renderBottomContent = () => {
- if (section === SignupSection.Email) {
- return (
- <p className="text-xs text-pretty text-label">
- By signing up, you agree to our{" "}
- <a
- href="https://infisical.com/terms/cloud"
- target="_blank"
- rel="noopener noreferrer"
- className="underline underline-offset-2 transition-colors duration-200 hover:text-foreground hover:decoration-project/45"
- >
- Terms of Service
- </a>{" "}
- and{" "}
- <a
- href="https://infisical.com/privacy"
- target="_blank"
- rel="noopener noreferrer"
- className="underline underline-offset-2 transition-colors duration-200 hover:text-foreground hover:decoration-project/45"
- >
- Privacy Policy
- </a>
- .
- </p>
- );
+ if (
+ section === SignupSection.Email ||
+ section === SignupSection.ProductSelect ||
+ section === SignupSection.InviteTeam ||
+ section === SignupSection.Complete
+ ) {
+ return termsNotice;
}
if (section === SignupSection.VerifyCode) {
@@ -197,8 +264,53 @@ export const SignUpPage = ({ invite }: SignUpPageProps) => {
return undefined;
};
+ // Without an email service the invite step is skipped, so the counter tops out at 3.
+ const totalSteps = serverDetails?.emailConfigured ? 4 : 3;
+ const stepNumber = STEP_NUMBERS[section];
+ const stepIndicator =
+ !isInvite && stepNumber ? (
+ <span className="rounded-sm border border-border bg-container/50 px-2.5 py-0.5 font-jetbrains-mono text-[10px] tracking-widest text-muted uppercase">
+ Step {stepNumber} of {totalSteps}
+ </span>
+ ) : undefined;
+
+ const completeAsideDescription = (() => {
+ if (selectedProducts.length === 0) return "Your organization overview has everything laid out.";
+ if (selectedProducts.length === 1) {
+ return `${getSignupProduct(selectedProducts[0])?.name} is set up and ready to use.`;
+ }
+ return "Your products are set up and ready to go.";
+ })();
+ const asideContent = (() => {
+ switch (section) {
+ case SignupSection.ProductSelect:
+ return {
+ eyebrow: "One platform, five products",
+ description:
+ "Secrets, PKI, KMS, privileged access, and scanning. Start where it hurts most."
+ };
+ case SignupSection.InviteTeam:
+ return {
+ eyebrow: "Better together",
+ description: "Infisical works best when your whole team is in one place."
+ };
+ case SignupSection.Complete:
+ return {
+ eyebrow: "You're all set",
+ description: completeAsideDescription
+ };
+ default:
+ return undefined;
+ }
+ })();
+
return (
- <AuthPageLayout showFooter={false} bottomContent={renderBottomContent()}>
+ <AuthPageLayout
+ showFooter={false}
+ bottomContent={renderBottomContent()}
+ headerAction={stepIndicator}
+ aside={asideContent}
+ >
<Helmet>
<title>{t("common.head-title", { title: t("signup.title") })}</title>
<link rel="icon" href="/infisical.ico" />
@@ -206,7 +318,9 @@ export const SignUpPage = ({ invite }: SignUpPageProps) => {
<meta property="og:title" content={t("signup.og-title") as string} />
<meta name="og:description" content={t("signup.og-description") as string} />
</Helmet>
- {section === SignupSection.VerifyCode ? (
+ {section === SignupSection.VerifyCode ||
+ section === SignupSection.ProductSelect ||
+ section === SignupSection.Complete ? (
<div className="w-full">{renderView()}</div>
) : (
<form className="w-full" onSubmit={(e) => e.preventDefault()}>