forge-dev-kit icon indicating copy to clipboard operation
forge-dev-kit copied to clipboard

Using dev-kit outside of Forge by decoupling @forge/bridge and @finesoftware/forge-jira-api

Open gablabelle opened this issue 3 years ago • 0 comments

Hello!

Not really an issue, more of a discussion starter. 😄 I recently watched your talk on YouTube.

It would be nice if we could also use this outside of Forge. For example, I'm building a SaaS app that will also connect to JIRA and this repo seems to contain everything I need to simplify this process, thanks to you guys.

And, at first glance, from what I understand from the code, is that your react hooks and the underlying methods used to make the API calls to communicate with the Atlassian servers, use the @forge/bridge package from which it imports a requestJira method which is basically just a wrapper around fetch, probably to manage request headers, tokens, etc.

If we could decouple @forge/bridge and @finesoftware/forge-jira-api and simply use a composition pattern that allows to pass requestJira OR our own "custom" fetch to, for example, a Provider instead, or to a factory function used for configuration, it would make it possible to use this dev kit outside of Forge.

My next.js app (running next-auth) would acquire an access_token via an Oauth flow and simply attach that access_token to every fetch requests sent to the JIRA servers.

Is this something you guys would be open to?

Screen Shot 2022-07-09 at 19 56 49

gablabelle avatar Jul 10 '22 04:07 gablabelle