Skip to content

docs: improve README ergonomics and document testing and bootstrap - #12

Merged
roncohen merged 1 commit into
mainfrom
docs/readme-ergonomics
Nov 28, 2026
Merged

roncohen merged 1 commit into
mainfrom
docs/readme-ergonomics

Conversation

@roncohen

Copy link
Copy Markdown
Contributor

Summary

  • Remove the Remote config note; developers starting with this SDK won't have Remote config.
  • Show a richer bind() context (email, name, attributes) and explain attribute flattening.
  • New Defaults and types: when get_flag() returns the default, and how the default sets the return type.
  • New Startup and status: an unreachable API doesn't raise; status is "degraded" and reads return defaults.
  • New Forking servers and workers: using a client after fork raises RuntimeError; create it per worker (gunicorn post_fork, Celery worker_process_init).
  • New Testing section, modelled on the Node SDK: offline mode, flag_overrides, set_flag_overrides(), scoped override_flags(), clear_flag_overrides().
  • New Bootstrapping browser clients: get_flags_for_bootstrap() → Browser SDK v2 bootstrappedState; only flags not marked secret, plus the bound context.

Testing

  • tests/test_examples.py now executes the Testing example (no secret key, no REFLAG_OFFLINE) and the bootstrap example (offline).
  • pytest tests/test_examples.py: 6 passed; ruff check/format clean.
  • Checked manually that an unreachable API gives status == "degraded" and defaults.

Note: the bootstrap section says Browser SDK v2 is required. Adjust the wording if v2 is still only on npm next.

@reflag-review reflag-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: low

no actionable findings

- Remove the Remote config note; new users won't have it.
- Explain when get_flag() returns the default and how defaults set types.
- Document startup status, fork safety, offline testing with overrides,
  and get_flags_for_bootstrap().
- Run the new README examples in tests.
@roncohen
roncohen force-pushed the docs/readme-ergonomics branch from 1d9e9bc to 0a2f9a3 Compare November 28, 2026 11:18

@reflag-review reflag-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: low

no actionable findings

@roncohen
roncohen merged commit 93d9765 into main Nov 28, 2026
16 checks passed
@roncohen
roncohen deleted the docs/readme-ergonomics branch November 28, 2026 11:42
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

Successfully merging this pull request may close these issues.

1 participant