diff --git a/apps/formbricks-com/components/docs/Layout.tsx b/apps/formbricks-com/components/docs/Layout.tsx index ac62162cd1..eebb413478 100644 --- a/apps/formbricks-com/components/docs/Layout.tsx +++ b/apps/formbricks-com/components/docs/Layout.tsx @@ -9,10 +9,9 @@ import { Button } from "@formbricks/ui"; import clsx from "clsx"; import Link from "next/link"; import { useRouter } from "next/router"; -import { useEffect, useState } from "react"; +import { useEffect, useRef, useState } from "react"; import MetaInformation from "../shared/MetaInformation"; import DocsFeedback from "./DocsFeedback"; -import { useRef } from "react"; function GitHubIcon(props: any) { return ( @@ -23,7 +22,6 @@ function GitHubIcon(props: any) { } function Header({ navigation }: any) { - const router = useRouter(); let [isScrolled, setIsScrolled] = useState(false); useEffect(() => { @@ -63,13 +61,15 @@ function Header({ navigation }: any) { variant="secondary" EndIcon={GitHubIcon} endIconClassName="fill-slate-800 dark:fill-slate-200 ml-2" - onClick={() => router.push("https://github.com/formbricks/formbricks")}> - View on Github + href="https://github.com/formbricks/formbricks" + target="_blank"> + Star us on Github @@ -101,6 +101,26 @@ export const Layout: React.FC = ({ children, meta }) => { sessionStorage.setItem("scrollPosition", (scroll + 89).toString()); }; + const useExternalLinks = (selector: string) => { + useEffect(() => { + const links = document.querySelectorAll(selector); + + links.forEach((link) => { + link.setAttribute("target", "_blank"); + link.setAttribute("rel", "noopener noreferrer"); + }); + + return () => { + links.forEach((link) => { + link.removeAttribute("target"); + link.removeAttribute("rel"); + }); + }; + }, [selector]); + }; + + useExternalLinks(".prose a"); + useEffect(() => { if (parentRef.current) { const scrollPosition = Number.parseInt(sessionStorage.getItem("scrollPosition"), 10); diff --git a/apps/formbricks-com/lib/docsNavigation.ts b/apps/formbricks-com/lib/docsNavigation.ts index 967017d4a7..604660a71f 100644 --- a/apps/formbricks-com/lib/docsNavigation.ts +++ b/apps/formbricks-com/lib/docsNavigation.ts @@ -44,6 +44,10 @@ const navigation = [ { title: "Docs Feedback", href: "/docs/best-practices/docs-feedback" }, ], }, + { + title: "Integrations", + links: [{ title: "Zapier", href: "/docs/integrations/zapier" }], + }, { title: "Link Surveys", links: [ diff --git a/apps/formbricks-com/pages/docs/api/api-key-setup/add-api-key.png b/apps/formbricks-com/pages/docs/api/api-key-setup/add-api-key.png new file mode 100644 index 0000000000..8ea4a144a1 Binary files /dev/null and b/apps/formbricks-com/pages/docs/api/api-key-setup/add-api-key.png differ diff --git a/apps/formbricks-com/pages/docs/api/api-key-setup/api-key-secret.png b/apps/formbricks-com/pages/docs/api/api-key-setup/api-key-secret.png new file mode 100644 index 0000000000..c30d79529a Binary files /dev/null and b/apps/formbricks-com/pages/docs/api/api-key-setup/api-key-secret.png differ diff --git a/apps/formbricks-com/pages/docs/api/api-key-setup/index.mdx b/apps/formbricks-com/pages/docs/api/api-key-setup/index.mdx index 97405577cd..1f7a208101 100644 --- a/apps/formbricks-com/pages/docs/api/api-key-setup/index.mdx +++ b/apps/formbricks-com/pages/docs/api/api-key-setup/index.mdx @@ -2,6 +2,10 @@ import { Layout } from "@/components/docs/Layout"; import { Fence } from "@/components/shared/Fence"; import { APILayout } from "@/components/shared/APILayout.tsx"; import { Callout } from "@/components/shared/Callout"; +import Image from "next/image"; + +import AddApiKey from "./add-api-key.png"; +import ApiKeySecret from "./api-key-secret.png"; export const meta = { title: "API Key Setup", @@ -16,9 +20,11 @@ The API requests are authorized with a personal API key. This API key gives you ### How to generate an API key 1. Go to your settings on [app.formbricks.com](https://app.formbricks.com). -2. Go to page “API keys”. +2. Go to page “API keys” + Add API Key 3. Create a key for the development or production environment. 4. Copy the key immediately. You won’t be able to see it again. + API Key Secret Anyone who has your API key has full control over your account. For security reasons, you cannot view the diff --git a/apps/formbricks-com/pages/docs/contributing/demo/index.mdx b/apps/formbricks-com/pages/docs/contributing/demo/index.mdx index 04d73f2b0d..a55cddc714 100644 --- a/apps/formbricks-com/pages/docs/contributing/demo/index.mdx +++ b/apps/formbricks-com/pages/docs/contributing/demo/index.mdx @@ -10,7 +10,7 @@ export const meta = { description: "To test in-app surveys, trigger actions and set attributes, you can use the Demo App.", }; -To play around with the user actions, you can use the Demo App. It's a simple React app that you can run locally and use to trigger actions and set attributes. +To play around with the in-app [User Actions](/docs/actions/why), you can use the Demo App. It's a simple React app that you can run locally and use to trigger actions and set [Attributes](/docs/attributes/why). Demo App Preview diff --git a/apps/formbricks-com/pages/docs/integrations/zapier/add-new-zap.png b/apps/formbricks-com/pages/docs/integrations/zapier/add-new-zap.png new file mode 100644 index 0000000000..02c3092b9b Binary files /dev/null and b/apps/formbricks-com/pages/docs/integrations/zapier/add-new-zap.png differ diff --git a/apps/formbricks-com/pages/docs/integrations/zapier/choose-event.png b/apps/formbricks-com/pages/docs/integrations/zapier/choose-event.png new file mode 100644 index 0000000000..3ecb524db5 Binary files /dev/null and b/apps/formbricks-com/pages/docs/integrations/zapier/choose-event.png differ diff --git a/apps/formbricks-com/pages/docs/integrations/zapier/connect-with-formbricks-1.png b/apps/formbricks-com/pages/docs/integrations/zapier/connect-with-formbricks-1.png new file mode 100644 index 0000000000..aaa91ad2f6 Binary files /dev/null and b/apps/formbricks-com/pages/docs/integrations/zapier/connect-with-formbricks-1.png differ diff --git a/apps/formbricks-com/pages/docs/integrations/zapier/connect-with-formbricks-2.png b/apps/formbricks-com/pages/docs/integrations/zapier/connect-with-formbricks-2.png new file mode 100644 index 0000000000..44d943b8f0 Binary files /dev/null and b/apps/formbricks-com/pages/docs/integrations/zapier/connect-with-formbricks-2.png differ diff --git a/apps/formbricks-com/pages/docs/integrations/zapier/duplicate-survey.png b/apps/formbricks-com/pages/docs/integrations/zapier/duplicate-survey.png new file mode 100644 index 0000000000..4d586acf54 Binary files /dev/null and b/apps/formbricks-com/pages/docs/integrations/zapier/duplicate-survey.png differ diff --git a/apps/formbricks-com/pages/docs/integrations/zapier/index.mdx b/apps/formbricks-com/pages/docs/integrations/zapier/index.mdx new file mode 100644 index 0000000000..bf301bdf8d --- /dev/null +++ b/apps/formbricks-com/pages/docs/integrations/zapier/index.mdx @@ -0,0 +1,102 @@ +import { Layout } from "@/components/docs/Layout"; +import { Fence } from "@/components/shared/Fence"; +import { Callout } from "@/components/shared/Callout"; +import Image from "next/image"; + +import AddNewZap from "./add-new-zap.png"; +import ChooseEvent from "./choose-event.png"; +import ConnectWithFB1 from "./connect-with-formbricks-1.png"; +import ConnectWithFB2 from "./connect-with-formbricks-2.png"; +import DuplicateSurvey from "./duplicate-survey.png"; +import SelectSurvey from "./select-survey.png"; +import SlackChannelMsg from "./slack-channel-msg.png"; +import SlackMsg from "./slack-message.png"; +import SubmitTestResponse from "./submit-test-response.png"; +import SuccessConnection from "./success-connected.png"; +import TestSubmission from "./test-submission.png"; +import UpdateQuestionId from "./update-question-id.png"; +import ZapierMessage from "./zapier-message.png"; + +export const meta = { + title: "Zapier Setup", + description: "Wire up Formbricks with Zapier and 5000+ other apps", +}; + +Zapier is a powerful ally. Hook up Formbricks with Zapier and you can send your data to 5000+ other apps. Here is how to do it. + + + Any changes in the survey cause additional work in the Zap. It makes sense to first settle on the survey you + want to run and then get to setting up Zapier. + + +## Step 1: Setup your survey incl. `questionId` for every question + +When setting up the Zap your life will be easier when you change the `questionId`s of your survey questions. You can only do so **before** you publish your survey. + +Update Question ID + +_In every question card in the Advanced Settings you find the Question ID field. Update it so that you’ll recognize the response tied to this question._ + + + You can only update the questionId when the survey was not yet published. Already published it? Just + **duplicate it** to update the questionIds. + Duplicate Survey + + +## Step 3: Send a test response + +In order to set up Zapier you’ll need a test response. This allows you to select the individual values of each response in your Zap. If you have Formbricks running locally and you want to set up an in-app survey, you can use our [Demo App](/docs/contributing/demo) to trigger a survey and submit a response. + +Submit Test Response + +## Step 4: Setup your Zap + +Go to [zapier.com](https://zapier.com) and create a new Zap. Search for “Formbricks” to get started: + +Add New Zap + +Then, choose the event you want to trigger the Zap on: + +Choose Event + +## Step 5: Connect Formbricks with Zapier + +Now, you have to connect Zapier with Formbricks via an API Key: + +Connect with Formbricks - 1 +Connect with Formbricks - 2 + +Now you need an API key. Please refer to the [API Key Setup](/docs/api/api-key-setup) page to learn how to create one. + +Once you copied it in the newly opened Zapier window, you will be connected: + +Successful Connection + +## Step 6: Select Survey + +Next, you can choose from all the surveys you have created in this environment: + +Select Survey + +## Step 7: Test your trigger + +Once you hit “Test” you will see the three most recent submissions for this survey. If you don’t have any submissions in the survey, submit one to continue setting up your Zap: + +Test Submission +_Now you're happy that you updated the questionId's_ + +## Step 8: Set up your Zap + +Now you have all the data you need at hand. The next steps depend on what you want to do with it. In this tutorial, we will send submissions to a Slack channel: + +Slack Channel Message + +In the action itself we can determine the data and layout of the message. Here, we only choose the submission data. You can also refer to the meta data of the submission and the [attributes](/docs/attributes/why) of the person who submitted the survey. + +Slack Message + +We now receive a notifcation in our Slack channel whenever a Churn survey is completed: + +Zapier Message + +export default ({ children }) => {children}; diff --git a/apps/formbricks-com/pages/docs/integrations/zapier/select-survey.png b/apps/formbricks-com/pages/docs/integrations/zapier/select-survey.png new file mode 100644 index 0000000000..af489b5c9d Binary files /dev/null and b/apps/formbricks-com/pages/docs/integrations/zapier/select-survey.png differ diff --git a/apps/formbricks-com/pages/docs/integrations/zapier/slack-channel-msg.png b/apps/formbricks-com/pages/docs/integrations/zapier/slack-channel-msg.png new file mode 100644 index 0000000000..dccaa6ff91 Binary files /dev/null and b/apps/formbricks-com/pages/docs/integrations/zapier/slack-channel-msg.png differ diff --git a/apps/formbricks-com/pages/docs/integrations/zapier/slack-message.png b/apps/formbricks-com/pages/docs/integrations/zapier/slack-message.png new file mode 100644 index 0000000000..df0c057762 Binary files /dev/null and b/apps/formbricks-com/pages/docs/integrations/zapier/slack-message.png differ diff --git a/apps/formbricks-com/pages/docs/integrations/zapier/submit-test-response.png b/apps/formbricks-com/pages/docs/integrations/zapier/submit-test-response.png new file mode 100644 index 0000000000..2476a8f07d Binary files /dev/null and b/apps/formbricks-com/pages/docs/integrations/zapier/submit-test-response.png differ diff --git a/apps/formbricks-com/pages/docs/integrations/zapier/success-connected.png b/apps/formbricks-com/pages/docs/integrations/zapier/success-connected.png new file mode 100644 index 0000000000..d8848fa2e7 Binary files /dev/null and b/apps/formbricks-com/pages/docs/integrations/zapier/success-connected.png differ diff --git a/apps/formbricks-com/pages/docs/integrations/zapier/test-submission.png b/apps/formbricks-com/pages/docs/integrations/zapier/test-submission.png new file mode 100644 index 0000000000..f7ff3cbccb Binary files /dev/null and b/apps/formbricks-com/pages/docs/integrations/zapier/test-submission.png differ diff --git a/apps/formbricks-com/pages/docs/integrations/zapier/update-question-id.png b/apps/formbricks-com/pages/docs/integrations/zapier/update-question-id.png new file mode 100644 index 0000000000..21705f00c3 Binary files /dev/null and b/apps/formbricks-com/pages/docs/integrations/zapier/update-question-id.png differ diff --git a/apps/formbricks-com/pages/docs/integrations/zapier/zapier-message.png b/apps/formbricks-com/pages/docs/integrations/zapier/zapier-message.png new file mode 100644 index 0000000000..a233212cfa Binary files /dev/null and b/apps/formbricks-com/pages/docs/integrations/zapier/zapier-message.png differ