Skip to content

Commit

Permalink
Add Formbricks version number to Setup Checklist (formbricks#712)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattinannt committed Aug 19, 2023
1 parent cf35186 commit 32d0409
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
"use client";

import CodeBlock from "@/components/shared/CodeBlock";
import { IS_FORMBRICKS_CLOUD } from "@formbricks/lib/constants";
import { TabBar } from "@formbricks/ui";
import Link from "next/link";
import Prism from "prismjs";
import "prismjs/themes/prism.css";
import { useEffect, useState } from "react";
import { IoLogoHtml5, IoLogoNpm } from "react-icons/io5";
import packageJson from "@/package.json";

const tabs = [
{ id: "npm", label: "NPM", icon: <IoLogoNpm /> },
Expand Down Expand Up @@ -35,7 +37,9 @@ export default function SetupInstructions({ environmentId }) {
if (typeof window !== "undefined") {
formbricks.init({
environmentId: "${environmentId}",
apiHost: "${window.location.protocol}//${window.location.host}",
apiHost: "${typeof window !== "undefined" && window.location.protocol}//${
typeof window !== "undefined" && window.location.host
}",
debug: true, // remove when in production
});
}`}</CodeBlock>
Expand Down Expand Up @@ -144,6 +148,14 @@ if (typeof window !== "undefined") {
</ul>
</div>
) : null}
{!IS_FORMBRICKS_CLOUD && (
<div>
<hr className="my-3" />
<p className="flex w-full justify-end text-sm text-slate-700">
Formbricks version: {packageJson.version}
</p>
</div>
)}
</div>
</div>
);
Expand Down

0 comments on commit 32d0409

Please sign in to comment.