Skip to content

docs: correct the examples in the marketing pages guide - #479

Merged
dferber90 merged 1 commit into
mainfrom
docs-marketing-pages-fix
Aug 18, 2026
Merged

docs: correct the examples in the marketing pages guide#479
dferber90 merged 1 commit into
mainfrom
docs-marketing-pages-fix

Conversation

@dferber90

Copy link
Copy Markdown
Collaborator

Summary

This change corrects two code examples in the marketing pages guide.

The identify example

  • Add two import statements. The statements show where Identify, dedupe and flag come from.
  • Give the identify constant the Identify<Entities> type. The type gives the correct type to the cookies parameter and to the headers parameter. You do not write these types again in the example.
  • Send cookies and headers to the getOrGenerateVisitorId function. The function needs the two parameters.
  • Keep the return statement and the marketingAbTest block.

Before this change, the example sent only cookies to the getOrGenerateVisitorId function. The example on the same page shows that the function needs cookies and headers. If you send only cookies, the code does not compile.

The proxy.ts example

Change the name of the exported function from marketingMiddleware to proxy.

Next.js reads the function with the name proxy from the proxy.ts file. The name marketingMiddleware is the old middleware name. The other pages of the documentation, and the example applications, use the name proxy.

Test

The change is a documentation change. It changes no application code.

Rename the Proxy function to `proxy` and simplify the `identify` example
with the `Identify` type helper.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Dominik Ferber <1765075+dferber90@users.noreply.github.com>
@vercel

vercelBot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentActionsUpdated (UTC)
flags-playgroundReadyReadyPreviewAug 18, 2026 4:24am
flags-sdk-devReadyReadyPreviewAug 18, 2026 4:24am
flags-sdk-snippetsReadyReadyPreviewAug 18, 2026 4:24am
flags-sdk-sveltekit-snippetsReadyReadyPreviewAug 18, 2026 4:24am
shirt-shopReadyReadyPreviewAug 18, 2026 4:24am
shirt-shop-apiReadyReadyPreviewAug 18, 2026 4:24am

@dferber90
dferber90 merged commit 6294177 into mainAug 18, 2026
22 checks passed
@dferber90
dferber90 deleted the docs-marketing-pages-fix branch August 18, 2026 06:59
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@dferber90@vincent-derks