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

Add unleash provider #1069

Open
4 of 5 tasks
jarebudev opened this issue Oct 16, 2024 · 5 comments · May be fixed by #1105
Open
4 of 5 tasks

Add unleash provider #1069

jarebudev opened this issue Oct 16, 2024 · 5 comments · May be fixed by #1105
Assignees
Labels
enhancement New feature or request

Comments

@jarebudev
Copy link

jarebudev commented Oct 16, 2024

Add unleash provider

Reasoning

I want to add an OpenFeature provider for unleash. This would be valuable because...

  • unleash is a popular open-source feature flag solution
  • can also use Gitlab as a flag provider for the JS SDK (Gitlab feature flagging uses an unleash compatible API)

Requirements:

  • generate provider via tooling
  • implement Provider interface
  • add tests
  • complete README
  • add the new provider to the OpenFeature docs

Resources

  • {useful-link}

Keep in mind the CONTRIBUTING guidelines: https://github.com/open-feature/js-sdk-contrib/blob/main/CONTRIBUTING.md

@jarebudev jarebudev added the enhancement New feature or request label Oct 16, 2024
@jarebudev
Copy link
Author

jarebudev commented Oct 16, 2024

I've started looking at contributing this.

I have a (very) rough implementation that I've tested locally. This uses the JS unleash proxy client
https://docs.getunleash.io/reference/sdks/javascript-browser

I will tidy this up then share what I've got so far as it would be good to get feedback from the community on what I've done before I proceed further.

@jarebudev
Copy link
Author

FYI I've been working on this as and when I can amongst other commitments. I'm hoping to have something to share for feedback this week

@dacevedo12
Copy link

dacevedo12 commented Nov 5, 2024

Are you intending this to be used against unleash instance, edge or proxy?

Seems like gitlab doesn't offer (or I couldn't find) a frontend api, meaning one must host its own unleash proxy to then communicate with gitlab. kinda complex

@jarebudev
Copy link
Author

Are you intending this to be used against unleash instance, edge or proxy?

Seems like gitlab doesn't offer (or I couldn't find) a frontend api, meaning one must host its own unleash proxy to then communicate with gitlab. kinda complex

Yeh I would use either Unleash Edge or Proxy in a production instance as per the reasons documented here https://docs.getunleash.io/reference/front-end-api

AFAIK the Edge or Proxy would be required to connect to Gitlab's feature flag api - even if you could use the frontend API you would likely want to use Edge or Proxy otherwise you could potentially run into Gitlab's rate limiting as The feature flag API is considered Unauthenticated traffic (from a given IP address).

I've been trying out what I've done locally against the unleash instance and edge. As per my previous comment I'm aiming to push what I've got working so far for feedback (next day or so)

@jarebudev
Copy link
Author

Hopefully better late than never, I've pushed up what I've done so far to create a JS OpenFeature Unleash Provider.

The provider utilises Unleash's proxy client for the browser

The provider evaluates flags in the same way as the Java Unleash provider - as per this README.

I've tested this against a locally-running unleash instance using a combination of unleash deployment models.

  • unleash directly using the frontend
  • unleash and edge
  • unleash and unleash-proxy

I've also tried this with Gitlab, connecting via the unleash-proxy.

Link to provider

Provider source

To test

I modifed the react-test-app

Build the provider locally and use npm link

TODO

I've still got a list of things to address before submitting a PR for this and will work through these when time allows.

  • Add tests
  • Support all of Unleash proxy client configuration options
  • Verify context
  • Verify event handling

All feedback welcome!

@jarebudev jarebudev linked a pull request Dec 5, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants