diff --git a/deno-hono/README.md b/deno-hono/README.md index 239cf7d..6e4121c 100644 --- a/deno-hono/README.md +++ b/deno-hono/README.md @@ -2,7 +2,7 @@ This example app demonstrates how to use feature flags and A/B testing on a server-rendered landing page to test and deliver different experiences to users. -We offer a full tutorial in our docs. +We offer a [full tutorial in our docs](https://docs.growthbook.io/guide/deno-hono). ## Start the Server diff --git a/deno-hono/growthbookMiddleware.ts b/deno-hono/growthbookMiddleware.ts index b22a548..607ed0e 100644 --- a/deno-hono/growthbookMiddleware.ts +++ b/deno-hono/growthbookMiddleware.ts @@ -9,10 +9,10 @@ export const growthbookMiddleware = createMiddleware<{ }>(async (c, next) => { // Instantiate GrowthBook with your connection details const gb = new GrowthBook({ - apiHost: "https://cdn.growthbook.io", - clientKey: "sdk-QHVPAFSjyMARduDY", + apiHost: "https://cdn.growthbook.io", // Update with your API host + clientKey: "YOUR-SDK-KEY", trackingCallback: (experiment, result) => { - console.log("Tracking", { experiment, result }); // Update function to send experiment exposure to your analytics platform + console.log("Experiment Viewed", { experiment, result }); // Update function to send experiment exposure to your analytics platform }, }); @@ -25,14 +25,14 @@ export const growthbookMiddleware = createMiddleware<{ setCookie(c, "gb_uuid", uuid); } - // Pass GrowthBook the ID and other attributes as need + // Pass GrowthBook the ID and other attributes as needed gb.setAttributes({ id: uuid, // ... }); // Initialize GrowthBook - await gb.init({ timeout: 5000 }); + await gb.init({ timeout: 1000 }); // Add the instance to the context c.set("gb", gb); diff --git a/deno-hono/src/components/Hero.tsx b/deno-hono/src/components/Hero.tsx index 08abd00..7781333 100644 --- a/deno-hono/src/components/Hero.tsx +++ b/deno-hono/src/components/Hero.tsx @@ -1,7 +1,7 @@ import { Props } from "../../main.tsx"; export function Hero({ gb }: Props) { - const headline = gb?.getFeatureValue( + const headline = gb.getFeatureValue( "headline", "Revolutionize Your Finances with AI", );