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

Is there an offline version for local development? #94

Closed
karlo-humanmanaged opened this issue Apr 24, 2023 · 3 comments
Closed

Is there an offline version for local development? #94

karlo-humanmanaged opened this issue Apr 24, 2023 · 3 comments

Comments

@karlo-humanmanaged
Copy link

No description provided.

@dferber90
Copy link
Collaborator

Unfortunately we don't have support for working offline at the moment.

However one way to do this yourself would be to:

  • create your own client which internally forwards calls to @vercel/edge-config if you want to work online
  • set up an environment variable like OFFLINE=1
  • make your own client check whether the env var if set
  • if it is set, return values from a local json file instead

Note that you'd need to import the JSON file directly into your code as reading the file system is not possible from the edge runtime. This might end up in your production bundle if you are not careful though. Another alternative would be to start a local server during development and have your custom client fetch form there instead.

It's a bit manual but it should get you there most of the way.

I'm curious about your use case for working offline. Is it because you are traveling and don't have wifi?

I'll close this issue for now as we have offline support on the roadmap anyhow. But it will likely be a bit until we get around to it.

@karlo-humanmanaged
Copy link
Author

Hi, thanks for the reply. Not only that a lot of us are on the road most of the time, we also need some flexibility around keys that would have different values depending on the task we're working on during local development e.g. api endpoints, auth audiences, etc

@dferber90
Copy link
Collaborator

dferber90 commented May 22, 2023

#166 should help here. Once that lands it will allow supplying your own custom connection string. That way you can run a custom edge config server while working offline during development.

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

No branches or pull requests

2 participants