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 docs for INNGEST_DEV and isDev #679

Merged
merged 3 commits into from
Feb 23, 2024
Merged

Add docs for INNGEST_DEV and isDev #679

merged 3 commits into from
Feb 23, 2024

Conversation

jpwilliams
Copy link
Member

@jpwilliams jpwilliams commented Feb 19, 2024

Summary

Adds docs for INNGEST_DEV and isDev for the release of inngest/inngest-js#488.

Related

@jpwilliams jpwilliams added the documentation Improvements or additions to documentation label Feb 19, 2024
@jpwilliams jpwilliams self-assigned this Feb 19, 2024
Copy link

vercel bot commented Feb 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
website ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 23, 2024 0:09am

jpwilliams added a commit to inngest/inngest-js that referenced this pull request Feb 23, 2024
## Summary
<!-- Succinctly describe your change, providing context, what you've
changed, and why. -->

Adds support for `INNGEST_DEV` and a new `isDev` option on the client.

This lightly refactors the current checks based around `isProd` and
`skipDevServer()`, which were getting a little difficult to read.

- The SDK now has two "modes:" `"dev"` and `"cloud"`.
- Each mode is either **explicit** or **inferred**. An inferred mode
means that the current (`v3.x.x`) version of the SDK can make a decision
to attempt to contact the Dev Server. Future versions will remove this
and default to `"cloud"` mode.
- Setting the `INNGEST_DEV` environment variable or the `isDev` client
option **explicitly** sets the mode to either `"cloud"` or `"dev"`.
- `INNGEST_DEV` accepts some sensible defaults. We'll recommend `1` to
explicitly set `"dev"` mode and `0` to explicitly set `"cloud"` mode,
though it also accepts `"true"`, `"y"`, `"no"`, etc.
- Explicitly setting either mode also sets the event ingestion and
syncing URLs. They continue to be further overwritten by passing
`INNGEST_BASE_URL`, `INNGEST_API_BASE_URL`, and
`INNGEST_EVENT_API_BASE_URL`.

> [!NOTE]
> To support many runtimes and environments, environment variables are
not always accessible a) at all times, and b) on `process.env`.
Sometimes environment variables are accessed via different global
objects, or sometimes runtime objects that are passed to requests.
>
> For this reason, handling environment variables is more complex and
relies on making best guesses during instantiation, then later making
another decision when we have access to the environment.

Supersedes both #424 and #425.

## Checklist
<!-- Tick these items off as you progress. -->
<!-- If an item isn't applicable, ideally please strikeout the item by
wrapping it in "~~"" and suffix it with "N/A My reason for skipping
this." -->
<!-- e.g. "- [ ] ~~Added tests~~ N/A Only touches docs" -->

- [x] Added a [docs PR](https://github.com/inngest/website) documenting
these modes and the new environment variables that references this PR
- [x] Added unit/integration tests
- [x] Added changesets if applicable
- [x] Push env-related changes to the OS SDK Spec

## Related
<!-- A space for any related links, issues, or PRs. -->
<!-- Linear issues are autolinked. -->
<!-- e.g. - INN-123 -->
<!-- GitHub issues/PRs can be linked using shorthand. -->
<!-- e.g. "- inngest/inngest#123" -->
<!-- Feel free to remove this section if there are no applicable related
links.-->
- INN-2754
- Supersedes #424
- Supersedes #425
- inngest/website#679
@jpwilliams jpwilliams merged commit 028dfb3 into main Feb 23, 2024
5 checks passed
@jpwilliams jpwilliams deleted the docs/inngest_dev branch February 23, 2024 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant