Settings

Theme

Show HN: next-flag ∙ Feature flags by GitHub Issues and NextJS

github.com

5 points by linesofcode 2 years ago · 2 comments · 2 min read

Reader

I built a package that provides a feature-flag service powered entirely by GitHub issues and NextJS.

Define a list of app features and environments in an issue description, then simply toggle a feature on/off by ticking a checkbox - without having to redeploy your app.

It can be used directly inside a NextJS app or be deployed as a standalone service and consumed by any client over HTTP. Plus it supports react server-side components right out of the box.

The architecture leverages GitHub Webhooks to invalidate the NextJS cache whenever there is a change. The next time a user reloads a page in their NextJS app the cache is repopulated with the latest enabled features by sending a request to GitHub.

Features:

- Define feature flags across multiple environments or branches.

- Supports React Server Side and Client Side Components. Powered by the NextJS Cache.

- Define custom conditions that are evaluated at runtime to enable or disable features.

- Can be deployed as a stand-alone service to manage feature flags for multiple NextJS apps.

- Totally free. Unlimited projects, features and environments.

How does it work?

1. Define a list of features using Markdown in a Github Issue.

2. Configure a Github Webhook that hits your self-hosted `/api/next-flag` route when a feature is toggled and invalidates the NextJS cache.

3. Consume the `next-flag` package anywhere in your code. Features are fetched once and cached. Supports React Server Side Components, React Hooks, or simply send an HTTP GET request to `/api/next-flag`.

ataschz 2 years ago

Hey, this looks great! I'm going to try it

  • linesofcodeOP 2 years ago

    Glad to hear it! Do let me know if there’s anything I can improve or implement to support your use case.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection