chore: move js sdk and demo app to its own repository (#5668)

This commit is contained in:
Matti Nannt
2025-05-05 21:03:54 +02:00
committed by GitHub
parent e0e42d2eed
commit bd22aaaa86
56 changed files with 13 additions and 1513 deletions

View File

@@ -1,12 +1,10 @@
"use client";
import { formbricksLogout } from "@/app/lib/formbricks";
import { signOut } from "next-auth/react";
import { useEffect } from "react";
export const ClientLogout = () => {
useEffect(() => {
formbricksLogout();
signOut();
});
return null;

View File

@@ -27,8 +27,6 @@ vi.mock("@/lib/constants", () => ({
WEBAPP_URL: "test-webapp-url",
IS_PRODUCTION: false,
SENTRY_DSN: "mock-sentry-dsn",
FORMBRICKS_API_HOST: "test-formbricks-api-host",
FORMBRICKS_ENVIRONMENT_ID: "test-formbricks-environment-id",
IS_FORMBRICKS_ENABLED: true,
}));
@@ -36,13 +34,6 @@ vi.mock("@/lib/constants", () => ({
vi.mock("@/app/(app)/environments/[environmentId]/components/ResponseFilterContext", () => ({
ResponseFilterProvider: ({ children }: any) => <div data-testid="ResponseFilterProvider">{children}</div>,
}));
vi.mock("@/app/(app)/components/FormbricksClient", () => ({
FormbricksClient: ({ userId, email }: any) => (
<div data-testid="FormbricksClient">
{userId}-{email}
</div>
),
}));
vi.mock("@/modules/ui/components/toaster-client", () => ({
ToasterClient: () => <div data-testid="ToasterClient" />,
}));
@@ -69,7 +60,6 @@ describe("EnvironmentIdBaseLayout", () => {
expect(screen.getByTestId("ResponseFilterProvider")).toBeInTheDocument();
expect(screen.getByTestId("PosthogIdentify")).toHaveTextContent("org1");
expect(screen.getByTestId("FormbricksClient")).toHaveTextContent("user1-user1@example.com");
expect(screen.getByTestId("ToasterClient")).toBeInTheDocument();
expect(screen.getByTestId("child")).toHaveTextContent("Test Content");
});

View File

@@ -1,12 +1,6 @@
import { FormbricksClient } from "@/app/(app)/components/FormbricksClient";
import { PosthogIdentify } from "@/app/(app)/environments/[environmentId]/components/PosthogIdentify";
import { ResponseFilterProvider } from "@/app/(app)/environments/[environmentId]/components/ResponseFilterContext";
import {
FORMBRICKS_API_HOST,
FORMBRICKS_ENVIRONMENT_ID,
IS_FORMBRICKS_ENABLED,
IS_POSTHOG_CONFIGURED,
} from "@/lib/constants";
import { IS_POSTHOG_CONFIGURED } from "@/lib/constants";
import { ToasterClient } from "@/modules/ui/components/toaster-client";
import { Session } from "next-auth";
import { TOrganization } from "@formbricks/types/organizations";
@@ -38,13 +32,6 @@ export const EnvironmentIdBaseLayout = async ({
organizationBilling={organization.billing}
isPosthogEnabled={IS_POSTHOG_CONFIGURED}
/>
<FormbricksClient
userId={user.id}
email={user.email}
formbricksApiHost={FORMBRICKS_API_HOST}
formbricksEnvironmentId={FORMBRICKS_ENVIRONMENT_ID}
formbricksEnabled={IS_FORMBRICKS_ENABLED}
/>
<ToasterClient />
{children}
</ResponseFilterProvider>