Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(statsig-adapter): Move Edge Config to peer deps, more consistent api key naming #43

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

AAorris
Copy link
Contributor

@AAorris AAorris commented Jan 20, 2025

Overview

Statsig has client | server | console api keys. We can shore up the naming with statsig, [type], and api key. Use this convention across the adapter.

Move Edge Config related dependencies to peer dependencies and dynamically import them when used, so that the flags SDK can be used without including Vercel if it's not needed.

Constrain the package.json requests to the major version, and let the app pin versions if desired

@AAorris AAorris requested review from dferber90 and AndyBitz January 20, 2025 21:14
@AAorris AAorris self-assigned this Jan 20, 2025
Copy link

vercel bot commented Jan 20, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
flags-sdk-snippets ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 30, 2025 0:20am
summer-sale ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 30, 2025 0:20am

Copy link

socket-security bot commented Jan 20, 2025

New, updated, and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@vercel/[email protected] None 0 79.3 kB vercel-release-bot
npm/[email protected] 🔁 npm/[email protected] None 0 238 kB react-bot
npm/[email protected] network +6 990 kB daniel-statsig

🚮 Removed packages: npm/[email protected]

View full report↗︎

"peerDependencies": {
"@vercel/edge-config": "~1.2.0",
"statsig-node-vercel": "~0.4.0"
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can further add this to mark the dependencies as optional

  "peerDependenciesMeta": {
    "@vercel/edge-config": {
      "optional": true
    },
    "statsig-node-vercel": {
      "optional": true
    }
  },

This way people not using Edge Config won't get warnings

Sign up for free to 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