The Ruby gem
Install the Ruby gem to run the widget from a Rails app.
Ruby (Rails)
Section titled “Ruby (Rails)”Add the gem to your Gemfile — until launch that’s a path: or
git: source pointing at the copy we send you rather than a bare
gem "vroxy" — then:
bundle installbin/rails generate vroxy:installVROXY_PUBLIC_KEY=your_public_key(VROXY_API_KEY still works as the legacy name for the public key.)
That’s it — every HTML response now carries the loader and an
identify() call.
Identity resolution. By default the gem reads
controller.current_user and pulls external_id from user.id,
email from user.email, name from full_name → name →
first_name + last_name, and role from user.role →
user.roles.first. Missing accessors are skipped, so a bare
User(id, email) still produces a useful payload. Everything other
than email, name and external_id travels under meta.
Custom resolver:
Vroxy.configure do |config| config.identify = ->(controller) { user = controller.current_user next nil unless user
{ external_id: user.id.to_s, email: user.email, name: user.display_name, role: user.admin? ? "admin" : "basic", meta: { plan: user.subscription&.plan_name } } }endReturn nil to stay anonymous for a request — useful during
impersonation, where you don’t want the impersonator’s identity
leaking to the widget.
Configuration:
| Key | Default | Purpose |
|---|---|---|
api_key |
ENV["VROXY_PUBLIC_KEY"] (or ENV["VROXY_API_KEY"]) |
Your workspace public key. |
endpoint |
ENV["VROXY_ENDPOINT"] or https://vroxy.ai |
Base URL of the Vroxy deployment. |
enabled |
true iff api_key present |
Master kill switch. |
auto_inject |
true |
Append the snippet before </body>. |
identify |
auto-detect | ->(controller) { {...} }; nil stays anonymous. |
exclude_paths |
[] |
Strings or Regexps matched against request.path. |
csp_nonce |
nil |
->(controller) { ... } for strict CSP. |
identity_secret |
ENV["VROXY_IDENTITY_SECRET"] |
Signs the identify payload’s access level. |
admin_roles |
%w[admin owner] |
Roles that sign as level: "admin". |
report_errors |
nil (auto: production + api_key) |
Ship exceptions to your Errors page. |
error_ignore |
RecordNotFound, RoutingError, … | Exception class names never reported. |
secret_token |
ENV["VROXY_SECRET_TOKEN"] |
A workspace API token with tenant:write, for server-to-server calls. Not the public key. |
glossary_admin_url |
nil |
->(term) { ... } building the admin deep-link template for a term. |
glossary_extra |
[] |
Extra glossary entries to sync alongside the ones mined from i18n. |
The last three exist for one task: bin/rails vroxy:sync_glossary
mines your activerecord.models translations for nouns whose display
label differs from the model name and pushes them to your workspace’s
glossary. See Bot settings for what the glossary
is used for.
Manual placement: set config.auto_inject = false and put
<%= vroxy_snippet %> before </body> in your layout. Even with
auto-injection on, calling the helper suppresses the middleware for
that request, so you can never get two copies.
Rails only: the gem also loads the in-page feedback inspector for
users whose resolved role is in admin_roles and whose identity is
signed as admin, along with the trail of partials Rails rendered for
that request. That’s what powers the feedback flow in
Feedback to fix. The Node, Python and WordPress packages
inject the same inspector for a signed admin — the partial trail is
the Rails-only extra.