Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ph #14

Merged
merged 2 commits into from
Apr 11, 2024
Merged
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "neosync",
"homepage": "https://neosync.dev",
"version": "1.0.6",
"version": "1.0.7",
"description": "Auth templates for Neosync Cloud",
"repository": {
"type": "git",
Expand Down
Empty file added src/PosthogProvider.tsx
Empty file.
35 changes: 23 additions & 12 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,34 @@ import { kcContext as kcLoginThemeContext } from "./login/kcContext";
const KcLoginThemeApp = lazy(() => import("./login/KcApp"));
const KcAccountThemeApp = lazy(() => import("./account/KcApp"));

import { PostHogProvider } from "posthog-js/react";

const options = {
api_host: "https://app.posthog.com",
};

createRoot(document.getElementById("root")!).render(
<StrictMode>
<Suspense>
{(() => {
if (kcLoginThemeContext !== undefined) {
return <KcLoginThemeApp kcContext={kcLoginThemeContext} />;
}
<PostHogProvider
apiKey="phc_yc5YUhGheWJL8XSKlLQJ9DYOH5Fi1IQyi7RB1TD4eyAY"
options={options}
>
{(() => {
if (kcLoginThemeContext !== undefined) {
return <KcLoginThemeApp kcContext={kcLoginThemeContext} />;
}

if (kcAccountThemeContext !== undefined) {
return <KcAccountThemeApp kcContext={kcAccountThemeContext} />;
}
if (kcAccountThemeContext !== undefined) {
return <KcAccountThemeApp kcContext={kcAccountThemeContext} />;
}

throw new Error(
"This app is a Keycloak theme" +
"It isn't meant to be deployed outside of Keycloak"
);
})()}
throw new Error(
"This app is a Keycloak theme" +
"It isn't meant to be deployed outside of Keycloak"
);
})()}
</PostHogProvider>
</Suspense>
</StrictMode>
);