build icon indicating copy to clipboard operation
build copied to clipboard

Expose the Netlify API host to plugins

Open JGAntunes opened this issue 4 years ago • 1 comments

Which problem is this feature request solving?

build allows a different non production host for the netlify API to be passed via flag: https://github.com/netlify/build/blob/a1cbf789bac18a83232a29c70390691442527693/packages/build/src/core/flags.js#L38-L42

We should have a way to pass this information down to plugins so that plugins such as netlify-plugin-edge-handlers have a way to test and work with different environments of our API.

Describe the solution you'd like

We have a couple of alternatives here, we can just pass the host as constant for example or we could actually have an util with a pre-initialized client that plugin authors could use. For this specific case however our js-client would probably need to be a bit more flexible (see https://github.com/netlify/js-client/issues/287 and https://github.com/netlify/js-client/issues/156)

Can you submit a pull request?

Yes

JGAntunes avatar Apr 30 '21 11:04 JGAntunes

With #2709 merged I'm wondering if we want to take further action here in terms of documenting this or not? Thanks to @ehmicky who pointed out to this discussion - https://github.com/netlify/build/pull/2288#discussion_r582811790 - I'm wondering if @verythorough has some thoughts on this?

And given the broader discussion happening here - https://github.com/netlify/pod-workflow/issues/33 - I'm wondering if we want to keep this open?

JGAntunes avatar May 04 '21 12:05 JGAntunes

This issue has been automatically marked as stale because it has not had activity in 1 year. It will be closed in 14 days if no further activity occurs. Thanks!

github-actions[bot] avatar Oct 11 '22 14:10 github-actions[bot]

Done via https://github.com/netlify/build/pull/2709

JGAntunes avatar Oct 12 '22 17:10 JGAntunes