diff --git a/generator/konfig-dash/api/src/functions/sdkSignupForm/sdkSignupForm.ts b/generator/konfig-dash/api/src/functions/sdkSignupForm/sdkSignupForm.ts index d3f8edb566..a652f430e5 100644 --- a/generator/konfig-dash/api/src/functions/sdkSignupForm/sdkSignupForm.ts +++ b/generator/konfig-dash/api/src/functions/sdkSignupForm/sdkSignupForm.ts @@ -74,26 +74,28 @@ async function createPageInDatabase({ [databaseProperties.Email.name]: { email: email, }, - [databaseProperties.Company.name]: { - rich_text: [ + [databaseProperties.Name.name]: { + title: [ { type: 'text', text: { - content: company, + content: 'New SDK Signup', }, }, ], }, - [databaseProperties.Name.name]: { - title: [ + } + if (company !== undefined) { + properties[databaseProperties.Company.name] = { + rich_text: [ { type: 'text', text: { - content: 'New SDK Signup', + content: company, }, }, ], - }, + } } if (language !== undefined) { properties[databaseProperties.Language.name] = { @@ -198,7 +200,7 @@ const databaseProperties = { const sdkSignupFormSchema = z.object({ email: z.string(), - company: z.string(), + company: z.string().optional(), service: z.string().optional(), language: z.union([z.literal('TypeScript'), z.literal('Python')]).optional(), }) diff --git a/generator/konfig-docs/src/components/SdkSignupForm.tsx b/generator/konfig-docs/src/components/SdkSignupForm.tsx new file mode 100644 index 0000000000..f7a20ceb43 --- /dev/null +++ b/generator/konfig-docs/src/components/SdkSignupForm.tsx @@ -0,0 +1,78 @@ +import { IconPencil } from "@tabler/icons-react"; +import { useSdkSignup } from "../util/use-sdk-signup"; +import { LoadingIcon } from "./LoadingIcon"; +import clsx from "clsx"; + +export function SdkSignupForm({ + doNotShowQuestion, +}: { + doNotShowQuestion?: boolean; +}) { + const { setEmail, signedUp, signedUpEmail, loading, handleSubmit, email } = + useSdkSignup({}); + + return ( +
+
+ {((!signedUp && !doNotShowQuestion) || signedUp) && ( +

+ {signedUp + ? `Thanks for signing up for access to Konfig SDKs 🎉!` + : `Start building faster with Konfig SDKs`} +

+ )} + {signedUp ? ( +
+

+ Your email, {signedUpEmail}, has + been successfully registered for access to Konfig SDKs. We will + notify you by email soon. +

+

+ For questions, please contact us at{" "} + + sdks@konfigthis.com + +

+
+ ) : null} + {signedUp ? null : ( + setEmail(e.target.value)} + /> + )} + {signedUp ? null : ( + + )} +
+
+ ); +} diff --git a/generator/konfig-docs/src/pages/sdk/index.mdx b/generator/konfig-docs/src/pages/sdk/index.mdx index cde618897b..4c12845900 100644 --- a/generator/konfig-docs/src/pages/sdk/index.mdx +++ b/generator/konfig-docs/src/pages/sdk/index.mdx @@ -2,9 +2,10 @@ image: /img/konfig-sdks.png title: Konfig SDKs for Public APIs description: Konfig SDKs is a one-of-a-kind service for developers that want to write and maintain less API integration code. If you're ready to simplify your API integrations, get started with Konfig today! - --- +import { SdkSignupForm } from "@site/src/components/SdkSignupForm"; +
![Banner](/img/konfig-sdks.png) @@ -14,6 +15,8 @@ write and maintain less API integration code. We do this by providing consistent and well-documented SDKs for your API integrations, reducing code in your codebase and ensuring it stays up-to-date. + + ## Why? External API integrations are a pain to develop. Writing and maintaining your @@ -50,6 +53,8 @@ We charge based on the number of SDKs you use. ## Interested? -Checkout the growing list of [SDKs](/sdk/category/all) we offer and email us for access at founders@konfigthis.com +Checkout the growing list of [SDKs](/sdk/category/all) and sign up below. + +
diff --git a/generator/konfig-docs/src/util/use-sdk-signup.ts b/generator/konfig-docs/src/util/use-sdk-signup.ts index a99c083e86..6e62b91463 100644 --- a/generator/konfig-docs/src/util/use-sdk-signup.ts +++ b/generator/konfig-docs/src/util/use-sdk-signup.ts @@ -5,7 +5,7 @@ export function useSdkSignup({ serviceName, language, }: { - company: string; + company?: string; serviceName?: string; language?: string; }) {