Ruby
Install the latest version
Add the gem to your Gemfile:
bundle add quonfig
Or, outside Bundler, gem install quonfig. Then:
require "quonfig" # not needed in Rails, where Bundler.require loads it
Quonfig.init
context = {
user: {
key: 123,
email: "alice@example.com"
},
team: {
key: 456,
name: "AliceCorp"
}
}
result = Quonfig.enabled? "my-first-feature-flag", context
puts "my-first-feature-flag is: #{result}"
Initialize Client
If you set QUONFIG_BACKEND_SDK_KEY as an environment variable, initializing the client is as easy as
Quonfig.init # reads QUONFIG_BACKEND_SDK_KEY env var by default
API URLs
By default the SDK derives all of its hostnames from QUONFIG_DOMAIN
(default quonfig.com): it fetches config from https://primary.quonfig.com,
streams live updates from https://stream.primary.quonfig.com, and
automatically fails over to https://secondary.quonfig.com (on separate
infrastructure). Failover and hedging are on by default — see
Reliability for the full model.
Override the list with the api_urls option (or point QUONFIG_DOMAIN at a
different domain to re-derive both legs). Pass both a primary and a
secondary URL to keep automatic failover; a single URL disables it (the SDK
logs a warning at init):
Quonfig.init(
Quonfig::Options.new(
api_urls: [
"https://primary.quonfig.com",
"https://secondary.quonfig.com",
],
)
)
Rails Applications
Initializing Quonfig in your application.rb will allow you to reference dynamic configuration in your environment (e.g. staging.rb) and initializers. This is useful for setting environment-specific config like your redis connection URL.
#application.rb
module MyApplication
class Application < Rails::Application
#...
Quonfig.init
end
end
Forking servers and forking jobs
Ruby threads do not survive fork(2), so a forked child needs its own Quonfig client. On Ruby 3.1+ the SDK handles this for you. It installs a Process._fork hook at load time, covering Puma clustered mode, Unicorn workers, Spring, Resque, the parallel gem, and a plain fork { ... } inside a Sidekiq job. No wiring is required.
After a fork, the child re-initializes on its first use of the client, exactly like a newly constructed client — including its on_init_failure policy: it fetches its own config and starts its own threads. It does not evaluate from the parent's snapshot. The hook itself does no I/O. So the first call in a forked child pays one fetch, and a child that never uses the client costs nothing — no fetch, no stream, no thread.
That first fetch blocks, and it blocks every other thread that reaches the client while it is in flight — they wait for it and then see the fetched config. One fetch, one stream dial, and one telemetry reporter per child, however many threads race the first request.
The default is on_init_failure: :fail, so if the child's fetch fails against every api_urls leg (primary and secondary both unreachable) the failure raises out of that first lookup, exactly as Quonfig::Client.new would at boot, and later lookups keep raising — without re-fetching — until the update channel lands an envelope. If you would rather a forked child serve defaults through an outage, set on_init_failure: :continue: a failed first fetch then logs one line and the child serves defaults until its stream or poller lands an envelope.
This matters when a worker is recycled during an outage. A Puma worker started by a phased restart or worker_timeout, a Unicorn worker replaced after a kill, or a Resque child forked per job while Quonfig is unreachable blocks on its first lookup for up to init_timeout_ms (10s by default). Under :fail it then raises on every lookup until Quonfig is reachable; under :wait that first request blocks until Quonfig is back. The master and the workers that were already running keep serving their last config, so during a long outage the fleet splits. If you recycle workers often (or fork per job), consider on_init_failure: :continue and make sure your in-code defaults are safe. See Forked workers and worker recycling.
connection_state never triggers the re-initialization: a diagnostic must not open a socket. A child that has not used the client yet reports :initializing, and flips to :connected after its first use, once the stream delivers its first frame.
Per-job forking pays per job. A Resque-style worker that forks a child per job (or Parallel.map with one row per process) pays, in each child that touches the client, one config fetch, one SSE dial, and — when the child exits normally — one telemetry POST at exit. That is the price of the child holding its own current config and its own telemetry window, and it is deliberate — the delivery service counts each of those connections as a real client. A child that never uses the client pays none of it.
The at-exit drain depends on the child running at_exit handlers at all. Parallel children do. Resque children call exit! by default, which skips every at_exit handler — so there is no drain and no telemetry POST unless you set RUN_AT_EXIT_HOOKS=1. Nothing else about the child changes; it just never flushes the evaluations it collected.
A fork never touches the process that forked. The parent keeps its stream, its poller, and its live config straight through any number of forks — so a long-lived process that forks workers and keeps evaluating stays current.
You don't need to call Quonfig.instance.after_fork_in_child in the parent. In the process that owns the client it is a no-op (the SDK compares the current pid against the one it stamped when the client was built).
Sidekiq OSS itself does not fork — it runs jobs on threads in one process — so Quonfig.init in your initializer is all it needs.
If you use SemanticLogger, you still need to reopen the logger in each fork.
- Puma
- Unicorn
- Sidekiq
On Ruby 3.1+, no Quonfig wiring is needed. If you use SemanticLogger, reopen it in the worker — Quonfig.fork is not needed in that block. The SDK has already handled the fork by the time on_worker_boot runs, and a Quonfig.fork call in a child the hook has already prepared simply returns the same client, so a leftover call is harmless:
# puma.rb (Ruby 3.1+)
on_worker_boot do
SemanticLogger.reopen # only if you are using SemanticLogger
end
On Ruby 3.0 (which has no Process._fork hook), rebuild the client yourself:
# puma.rb (Ruby 3.0 only)
on_worker_boot do
Quonfig.fork # rebuild a fresh client per worker
SemanticLogger.reopen # if you are using SemanticLogger
end
Do not add a before_fork { Quonfig.instance.stop } — the master does not need to be torn down for the workers to be healthy, and stopping it means the master stops receiving config.
On Ruby 3.1+, no Quonfig wiring is needed. If you use SemanticLogger, reopen it in the worker — Quonfig.fork is not needed in that block, for the same reason as Puma above (the SDK has already handled the fork, and the call just returns the client the hook prepared):
# unicorn.rb (Ruby 3.1+)
after_fork do |server, worker|
SemanticLogger.reopen # only if you are using SemanticLogger
end
On Ruby 3.0, rebuild the client yourself:
# unicorn.rb (Ruby 3.0 only)
after_fork do |server, worker|
Quonfig.fork # rebuild a fresh client per worker
SemanticLogger.reopen # if you are using SemanticLogger
end
Sidekiq OSS runs jobs on threads, so Quonfig.init in your initializer is sufficient — there is nothing to wire up.
Jobs that fork (the parallel gem, an explicit fork { ... }, Sidekiq Enterprise swarm) are covered automatically on Ruby 3.1+, with nothing to call, and the Sidekiq process itself keeps streaming config throughout.
Ruby 3.0 is end-of-life and has no Process._fork hook. The parallel gem has no per-worker boot hook to wire a rebuild into either — Parallel.each just runs your block in each child, once per row — so calling Quonfig.fork at the top of the block builds a new client per row, each with its own SSE stream and telemetry reporter. Upgrade to 3.1+ if you can. If you must stay on 3.0, rebuild once per child process by memoizing on the pid:
# Ruby 3.0 only — one rebuild per child process, not one per row.
Parallel.each(batch, in_processes: 4) do |row|
Quonfig.fork if $quonfig_pid != Process.pid
$quonfig_pid = Process.pid
# ...
end
Feature Flags
For boolean flags, you can use the enabled? convenience method:
if Quonfig.enabled?("my-first-feature-flag")
# ...
else
# ...
end
Feature flags don't have to return just true or false.
You can get other data types using get, or with the typed getters:
Quonfig.get("ff-with-string")
Quonfig.instance.get_int("ff-with-int", default: 0)
enabled? is true only when the flag resolves to the bool true. It never raises: a missing key, a flag with no matching rule, a non-bool value (a stored string "true" included) or any resolution error returns false and logs one WARN per key.
Context
Feature flags become more powerful when we give the flag evaluation rules more information to work with. We do this by providing context of the current user (and/or team, request, etc.)
Global Context
When initializing the client, you can set a global context that will be used for all evaluations.
Quonfig.init(
global_context: {
application: {key: "my.corp.web"},
cpu: {count: 4},
clock: {timezone: "UTC"}
}
)
Global context is the least specific context and will be overridden by more specific context passed in at the time of evaluation.
Request-scoped context with a bound client
The Ruby SDK has no thread-local or ambient context. with_context binds a context to a Quonfig::BoundClient: with a block it yields the bound client, and without one it returns it. Only calls made through that bound client see the context; plain Quonfig.enabled? and Quonfig.get calls do not.
Quonfig.with_context(user: { key: "user-123", plan: "pro" }) do |bound|
bound.enabled?("beta-feature")
bound.get_string("homepage-hero", default: "Welcome")
end
In Rails, build the bound client once per request in a before_action and evaluate through it:
# application_controller.rb
class ApplicationController < ActionController::Base
before_action :set_quonfig
helper_method :quonfig
private
attr_reader :quonfig
def set_quonfig
@quonfig = Quonfig.with_context(quonfig_context)
end
def quonfig_context
{
device: {
mobile: mobile?
# ...
},
}.merge(quonfig_user_context)
end
def quonfig_user_context
return {} unless current_user
{
user: {
key: current_user.tracking_id,
id: current_user.id,
email: current_user.email,
country: current_user.country,
# ...
},
}
end
end
Then, in actions and views, call quonfig.enabled?("my-flag") or quonfig.get_int("max-items", default: 10). A BoundClient has the typed getters, the *_details getters, get_or_raise, enabled? and in_context(additional) (which returns a new bound client with more context); it has no untyped get.
Just-in-time Context
You can also pass context when evaluating individual flags or config values.
context = {
user: {
id: 123,
key: 'user-123',
subscription_level: 'pro',
email: "alice@example.com"
},
team: {
id: 432,
key: 'team-abc',
},
device: {
key: "abcdef",
mobile: true,
}
}
result = Quonfig.enabled?("my-first-feature-flag", context)
puts "my-first-feature-flag is: #{result} for #{context.inspect}"
Dynamic Config
Config values are accessed the same way as feature flag values. get works for all data types:
config_key = "my-first-int-config"
puts "#{config_key} is: #{Quonfig.get(config_key)}"
Typed getters
The typed getters live on the client (Quonfig.instance, or a Quonfig::Client you built) and on a bound client. Each takes default: and, on the client, context::
client = Quonfig.instance
client.get_string("app.display-name", default: "Acme")
client.get_int("rate-limit", default: 100, context: { user: { key: "user-123" } })
client.get_float("sample-rate", default: 0.1)
client.get_bool("beta-banner", default: false)
client.get_string_list("allowed-regions", default: [])
client.get_duration("request-timeout", default: 5_000) # integer milliseconds
client.get_json("pricing-table", default: {})
They follow the shared typed-getter contract:
- A missing key returns your
default:. A read that fails (a value of another type, a malformed value, an unset ENV_VAR, a decryption failure) also returns yourdefault:, and logs one WARN per key. - There is no string coercion: a stored string
"false"is not a bool, and"3"is not a number. - With no
default:,on_no_defaultdecides::raise(the default) raises,:return_nilreturnsnil. get_or_raise(key, default: ...)raises on an unset ENV_VAR, a malformed value or a decryption failure even when you pass adefault:. Use it for reads that must be fatal.- The
*_detailsgetters (get_bool_details,get_int_details, ...) never raise and return the value with a reason and, on failure, an error code.
2.0 changed these rules: in 1.x a typed getter raised even when you passed a default:, enabled? returned true for a stored string "true", and enabled? could raise. See the UPGRADE to 2.0 notes.
Default Values for Configs
Here we ask for the value of a config named max-jobs-per-second, and we specify 10 as a default value if no value is available.
Quonfig.get("max-jobs-per-second", 10) # => returns `10` if no value is available
If we don't provide a default and no value is available, a Quonfig::Errors::MissingDefaultError error will be raised.
Quonfig.get("max-jobs-per-second") # => raises if no value is available
You can modify this behavior by setting the option on_no_default to Quonfig::Options::ON_NO_DEFAULT::RETURN_NIL
Developer overrides (qfg override)
The qfg override CLI flips a flag for your developer machine without affecting anyone else. It does this by writing a top-priority rule on the flag keyed on the property quonfig-user.email. The SDK injects that property automatically whenever the qfg login token file is present, so the rule is dead code in production by construction (a server that never ran qfg login has no quonfig-user.email on its eval context, and the rule cannot fire).
Injection is on by default — when ~/.quonfig/tokens.json (written by qfg login) exists, the SDK reads it on init and merges { 'quonfig-user' => { 'email' => <user_email> } } into the global context. Customer-supplied quonfig-user keys (set via global_context:) win on collision. If the file is missing or unparseable the SDK is a no-op — init still succeeds.
To opt out (e.g. on a shared box where qfg login has run):
Quonfig.init(
Quonfig::Options.new(
enable_quonfig_user_context: false, # opt out
)
)
Or set QUONFIG_DEV_CONTEXT=false in the environment. Precedence: the explicit option wins, then QUONFIG_DEV_CONTEXT, then the default (true).
Telemetry note: quonfig-user.email flows through telemetry like any other context attribute. It only appears in dev-machine telemetry because production never injects it.
Dynamic Log Levels
Log levels in Quonfig are stored as a log_level config (e.g. log-level.my-app). The SDK consults that config on every log call, so changes made in Quonfig take effect live via SSE without redeploying.
Concept
- One
log_levelconfig per app, keyed likelog-level.my-app. Value is one ofTRACE,DEBUG,INFO,WARN,ERROR,FATAL. - Tell the client which config to consult via
Quonfig::Options.new(logger_key: ...). should_log?(logger_path:, desired_level:)pusheslogger_pathinto the evaluation context asquonfig-sdk-logging.key(verbatim — no normalization) so a single config can drive per-class rules.- Logger names flowing through
quonfig-sdk-logging.keyare auto-captured by example-context telemetry, so the dashboard can auto-suggest rule targets.
Basic usage
require "quonfig"
options = Quonfig::Options.new(
sdk_key: ENV.fetch("QUONFIG_BACKEND_SDK_KEY"),
logger_key: "log-level.my-app",
)
Quonfig.init(options)
if Quonfig.instance.should_log?(
logger_path: "MyApp::Services::Auth",
desired_level: :debug,
)
# ...
end
Rules
Set levels with the qfg CLI. Each --target adds a rule that matches every logger whose name starts with that prefix:
# Default to INFO for every logger in this app
qfg log-level log-level.my-app --value=INFO
# Bump one subsystem to DEBUG
qfg log-level log-level.my-app --target=MyApp::Services::Auth --value=DEBUG
# Quiet a chatty library, in one environment only
qfg log-level log-level.my-app --target=SomeGem --value=ERROR --environment=production
For rules on other properties, such as turning on DEBUG for one developer by user.email, add the rule in the Quonfig app. Dynamic Log Levels walks through rule order and shows the stored JSON.
The evaluator sees your global context plus quonfig-sdk-logging.key, so logger rules can combine with global-context attributes. Request context is not included: the logger has no access to a bound client. To include it, call Quonfig.instance.should_log?(logger_path:, desired_level:, contexts: ...) with that context yourself.
SemanticLogger integration
SemanticLogger is a popular structured logging framework. Attach a filter built by semantic_logger_filter(config_key:) and SemanticLogger will gate each record through Quonfig:
- Ruby
- Rails
# Gemfile
gem "semantic_logger"
require "semantic_logger"
require "quonfig"
Quonfig.init(Quonfig::Options.new(logger_key: "log-level.my-app"))
SemanticLogger.sync!
SemanticLogger.default_level = :trace # let Quonfig do the filtering
SemanticLogger.add_appender(
io: $stdout,
formatter: :json,
filter: Quonfig.instance.semantic_logger_filter(config_key: "log-level.my-app"),
)
# Gemfile
gem "amazing_print"
gem "rails_semantic_logger"
# config/application.rb
Quonfig.init(Quonfig::Options.new(logger_key: "log-level.my-app"))
# config/initializers/logging.rb
SemanticLogger.sync!
SemanticLogger.default_level = :trace # let Quonfig do the filtering
SemanticLogger.add_appender(
io: $stdout,
formatter: Rails.env.development? ? :color : :json,
filter: Quonfig.instance.semantic_logger_filter(config_key: "log-level.my-app"),
)
Please read the Puma/Unicorn notes for special considerations with forking servers.
The filter uses the SemanticLogger log's name as the quonfig-sdk-logging.key context value, so a rule such as --target=MyApp::Services::Auth matches out of the box.
Stdlib Logger integration
If you use Ruby's standard library Logger, attach a Quonfig::Client#stdlib_formatter:
require "logger"
require "quonfig"
Quonfig.init(Quonfig::Options.new(logger_key: "log-level.my-app"))
logger = Logger.new($stdout)
logger.level = Logger::DEBUG # let Quonfig do the filtering
logger.formatter = Quonfig.instance.stdlib_formatter(logger_name: "MyApp::Services::Auth")
logger.debug "filtered by Quonfig"
logger.info "filtered by Quonfig"
The formatter asks Quonfig should_log?(logger_path:, desired_level:) before each line. logger_name: is passed verbatim as quonfig-sdk-logging.key. If you omit logger_name: the formatter falls back to the logger's progname.
Telemetry
By default, Quonfig uploads telemetry that enables a number of useful features. You can alter or disable this behavior using the following options:
| Name | Description | Default |
|---|---|---|
| collect_evaluation_summaries | Send counts of config/flag evaluation results back to Quonfig to view in web app | true |
| context_upload_mode | Upload either context "shapes" (the names and data types your app uses in Quonfig contexts) or periodically send full example contexts | :periodic_example |
Logger names flowing through quonfig-sdk-logging.key are picked up by the normal example-context telemetry, so no separate logger-counts toggle is needed — the dashboard sees candidate logger names via the same path.
If you want to change any of these options, you can pass an options object when initializing the Quonfig client.
#application.rb
module MyApplication
class Application < Rails::Application
#...
options = Quonfig::Options.new(
collect_evaluation_summaries: true,
context_upload_mode: :periodic_example,
)
Quonfig.init(options)
end
end
Delivery options
How the SDK delivers telemetry, and what it does when the endpoint is slow or down, is the same in
every SDK and is explained once on the Telemetry page.
The Ruby option names and defaults, all passed to Quonfig::Options.new:
| Option | Default |
|---|---|
collect_sync_interval | 60 (seconds) |
telemetry_timeout_ms | 15_000 (15s) |
telemetry_connect_timeout_ms | 5_000 (5s) |
telemetry_max_retained_batches | 5 |
telemetry_max_retained_bytes | 2_097_152 (2MB) |
telemetry_max_retained_age_ms | 300_000 (5 min) |
collect_max_evaluation_summaries | 10_000 |
context_max_size | 10_000 (context-shape fields, and separately example contexts) |
For the five telemetry_* options, an invalid value (non-numeric, or <= 0) falls back to the
default. collect_sync_interval falls back to 60 only when it is nil. collect_max_evaluation_summaries
and context_max_size are not validated: set either to 0 to turn off that aggregator. The SDK's default logger prints
warnings and errors only; pass logger: to see the debug and info lines. stop and the reporter's
at_exit hook send the current window once with a 5s deadline.
Keeping batches small. A single batch larger than telemetry_max_retained_bytes is sent once
and, if that POST fails, dropped rather than kept. Large batches come from example contexts. If you
see telemetry drop warnings with large batches, use context_upload_mode: :shapes_only or a lower
context_max_size.
Debugging
In the rare case that you are trying to debug issues that occur within the library, set env var
QUONFIG_LOG_CLIENT_BOOTSTRAP_LOG_LEVEL=debug
Invalid or revoked SDK key
If Quonfig rejects the SDK key while the client is running, the client stops streaming, probes every 150-300 seconds until the key works again, and logs one ERROR naming the HTTP status and host (never the key). The full rule is on the Reliability page.
While the key is rejected, connection_state returns :disconnected (never
:falling_back) and terminal_failure? returns true. Evaluation keeps
serving the last installed configuration, and the client recovers by itself on
the first accepted probe.
terminal_failure? means "the key is rejected right now" and goes back to
false when a probe is accepted, so you don't need to rebuild the client when
you see true.
Asset Precompilation in Rails
Developers trying to run rake assets:precompile or rails assets:precompile in CI/CD know the pain of missing environment variables. Quonfig can help with this, but you don't want to hardcode your Quonfig SDK key in your Dockerfile. What should you do instead?
We recommend running in datadir mode for assets:precompile. Pull your workspace config files locally with the Quonfig CLI:
qfg pull --dir ./config
# clones your workspace config files to ./config
./config is its own git checkout. Run qfg pull as a build step, or copy the files into your repo or Docker build context without the .git directory; see Get a local copy.
Now point the SDK at that directory for assets:precompile. The client boots from the local files and makes no config-delivery requests (telemetry is sent only if an SDK key is set; see Local Workspace):
QUONFIG_DIR=./config QUONFIG_ENVIRONMENT=production bundle exec rake assets:precompile
Set QUONFIG_ENVIRONMENT to whichever environment you want to evaluate (development, production, or any environment your workspace defines). Re-run qfg pull to refresh the local files.
Testing
Test Setup
You can run your tests against a datadir for consistency, reproducibility, and offline testing. See Testing with a datadir.
If you need to test multiple scenarios that depend on a single config or feature key, you can change the Quonfig value using a mock or stub.
Example Test
Imagine we want to test a batches method on our Job class. batches depends on job.batch.size and the value for job.batch.size in our default config file is 3.
We can test how batches performs with different values for job.batch.size by mocking the return value of Quonfig.get.
class Job < Array
def batches
slice_size = Quonfig.get('job.batch.size')
each_slice(slice_size)
end
end
RSpec.describe Job do
describe '#batches' do
it 'returns batches of jobs' do
jobs = Job.new([1, 2, 3, 4, 5])
expect(jobs.batches.map(&:size)).to eq([3, 2])
allow(Quonfig).to receive(:get).with('job.batch.size').and_return(2)
expect(jobs.batches.map(&:size)).to eq([2, 2, 1])
end
end
end
Reference
If Quonfig is unreachable at startup
Client.new fetches config from both delivery legs (primary, then the
secondary in parallel) and retries through blips with a jittered backoff
(0.5s, 1s, 2s ... capped at 30s) for up to init_timeout_ms (default 10s).
A healthy boot logs nothing above DEBUG. If no config has loaded by then,
on_init_failure decides:
| Value | At init_timeout_ms | Every configured leg rejects the SDK key (401/403/404/410) |
|---|---|---|
:fail (default) | Raises Quonfig::Errors::InitializationError (reason :unavailable), or its subclass InitializationTimeoutError (reason :timeout) when the last attempt hung (none of its legs answered). No client is returned, so your orchestrator's restart is the retry. | Raises at once (reason :unauthorized). |
:wait | Keeps blocking and retrying, with no upper bound, logging a WARN every 30s. | Logs an ERROR and keeps retrying. |
:continue | Returns a client with no config: getters return your default (and get_or_raise raises MissingDefaultError). It keeps retrying in the background and serves live config as soon as it lands. | Returns at once. |
init_timeout_ms of zero or less runs exactly one attempt, then applies
on_init_failure; it does not mean "no deadline".
begin
client = Quonfig::Client.new(sdk_key: key, on_init_failure: :fail, init_timeout_ms: 10_000)
rescue Quonfig::Errors::InitializationError => e
e.reason # => :unavailable, :unauthorized or :timeout
e.errors # => "primary=primary.quonfig.com:443: ...; secondary=secondary.quonfig.com:443: ..."
raise
end
InitializationError is not a bare RuntimeError, so a
rescue RuntimeError around Client.new doesn't catch it; rescue
Quonfig::Errors::InitializationError instead.
Readiness: client.ready? is true once config has loaded, and
client.wait_for_ready(timeout_ms: nil) blocks until it has (true) or the
timeout runs out (false). Under :continue or :wait, point your readiness
probe at ready?. :raise and :return are the deprecated spellings of
:fail and :continue; they still work and log a one-time WARN. For how to
choose between the three, see
If Quonfig Is Unreachable at Startup.
Client Initialization Options
For more control, you can initialize your client with options. Here are the defaults with explanations.
options = Quonfig::Options.new(
sdk_key: ENV['QUONFIG_BACKEND_SDK_KEY'],
api_urls: ['https://primary.quonfig.com', 'https://secondary.quonfig.com'], # primary + secondary (failover on by default). Derived from ENV['QUONFIG_DOMAIN'] when omitted; SSE URL is derived by prepending 'stream.'
on_no_default: Quonfig::Options::ON_NO_DEFAULT::RAISE, # ::RAISE (:raise) or ::RETURN_NIL (:return_nil)
init_timeout_ms: 10_000, # how long to wait before on_init_failure (the old initialization_timeout_sec, in seconds, is a deprecated alias)
on_init_failure: Quonfig::Options::ON_INITIALIZATION_FAILURE::FAIL, # :fail (raise), :wait (keep blocking) or :continue (start on code defaults) if no config loads within init_timeout_ms; :raise / :return are deprecated aliases. See "If Quonfig is unreachable at startup".
datadir: ENV['QUONFIG_DIR'], # local workspace dir for offline/datadir mode
logger_key: nil, # the `log_level` config key consulted by `should_log?(logger_path:, ...)`, e.g. "log-level.my-app"
enable_quonfig_user_context: nil, # inject quonfig-user.email from ~/.quonfig/tokens.json (qfg login). Pairs with `qfg override`. Default on, gated on the token file's presence (inert in prod). Set false or QUONFIG_DEV_CONTEXT=false to opt out.
collect_max_paths: Quonfig::Options::DEFAULT_MAX_PATHS,
collect_sync_interval: 60, # seconds between telemetry flushes (nil also means 60)
context_upload_mode: :periodic_example, # :periodic_example, :shapes_only, :none
context_max_size: Quonfig::Options::DEFAULT_MAX_EVAL_SUMMARIES,
collect_evaluation_summaries: true, # send counts of config/flag evaluation results back to Quonfig to view in web app
collect_max_evaluation_summaries: Quonfig::Options::DEFAULT_MAX_EVAL_SUMMARIES,
global_context: {}
)
Quonfig.init(options)