Skip to content

Add Optimizely adapter - #164

Open
blurrah wants to merge 22 commits into
mainfrom
optimizely-adapter-edge
Open

Add Optimizely adapter#164
blurrah wants to merge 22 commits into
mainfrom
optimizely-adapter-edge

Conversation

@blurrah

@blurrahblurrah commented Sep 5, 2025

Copy link
Copy Markdown

This adds an Optimizely adapter for use with the flag() function.

It optimizes Optimizely (hah) for use with serverless/edge runtimes by offloading event dispatches to waitUntil() and sets up fetch() as a request handler instead of node https.

This is still a naive implementation where each individual event dispatch (if you're tracking experiments for the flag) gets added to waitUntil(). There's no batching or time based flushing happening for longer living instances.

The adapter has the following functions:

  • decide() to decide on a feature flag, can be directly used as adapter
  • userContext() which returns a user context interface so users can track events for example, more of a helper function Dropped this for now as I need to properly make it work with a deduped identify function
  • initialize() to get an initialized Optimizely instance

Based off of #175 for now so I can import their universal SDK.

Extra notes:

  • Was playing around with pnpm versions to link so I remade the lockfile a few times 🙈

@vercel

vercelBot commented Sep 5, 2025

Copy link
Copy Markdown
Contributor

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

ProjectDeploymentPreviewCommentsUpdated (UTC)
flags-sdk-snippetsReadyReadyPreviewCommentSep 24, 2025 5:16am
flags-sdk-sveltekit-snippetsReadyReadyPreviewCommentSep 24, 2025 5:16am
shirt-shopReadyReadyPreviewCommentSep 24, 2025 5:16am

@blurrah
blurrahforce-pushed the optimizely-adapter-edge branch from eee79dd to eec87bcCompareSeptember 12, 2025 12:03
@blurrah
blurrahforce-pushed the optimizely-adapter-edge branch from fc98ece to 4da2df3CompareSeptember 16, 2025 13:27
@dferber90

Copy link
Copy Markdown
Collaborator

I created a snapshot release as v0.2.0-bcd73bd1-20250924051654

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

@blurrah@dferber90