Review dependencies and client bundle secrets
Everything shipped to the browser is public to its recipient
Client bundles, static assets, network responses and source maps can be inspected. In Vite, variables exposed with the default VITE_ prefix are substituted into client code when used. They may hold public configuration, never private signing keys, database passwords or privileged API credentials. Custom envPrefix or build plugins can expose additional values; an unprefixed name alone is not proof of secrecy. Keep privileged operations on a trusted server and minimize the data it returns.
export const publicConfig = { deskName: 'Equipment lending desk', apiBase: '/api'};This object contains only public display text and a relative API path. A Vite app could read a public display label from import.meta.env.VITE_DESK_NAME. It must not serialize server configuration into the page or bundle. Removing a source map does not turn a shipped secret into a private value. Review emitted JavaScript, HTML, maps, server-to-client props and telemetry before publication. If a real credential was exposed, revoke or rotate it and investigate affected access; removing it from the next build is insufficient.
Minimize telemetry at the source
const knownEvents = new Set(['request_opened', 'request_cancelled', 'request_error']);export function diagnosticEvent(event) { if (!knownEvents.has(event.kind)) return null; return {kind: event.kind, outcome: event.outcome === 'ok' ? 'ok' : 'error'};}For a synthetic event with private notes or extra fields, only kind and outcome leave this projection. An unsupported event is dropped. Real diagnostics also need retention, access controls, consent or applicable privacy review, and a policy for identifiers. Never send whole request objects, cookies, tokens, full URLs or unreviewed error stacks to analytics. Restrict source-map access where needed for debugging; it is not a security boundary for embedded secrets.
Review dependencies and release evidence
export function securityReady(evidence) { const gates = ['dependencyReview', 'advisoryReview', 'bundleReview', 'serverAuthorization', 'browserPolicyReview', 'privacyReview']; return gates.every(key => evidence[key] === 'passed') && evidence.unresolvedCritical === 0;}This function models required evidence for the fictional desk, not a scanner. A missing result or unresolved critical finding blocks release. Maintain a reviewed lockfile, inspect direct and transitive dependencies, check official React/framework advisories and package advisories, review provenance and lifecycle scripts, and test upgrades before rollout. npm audit is a useful known-vulnerability check but sends dependency information to the configured registry; use only approved projects and network access. A clean report does not prove security. Do not apply forced upgrades blindly. React Server Components integrations in particular require checking current patched package combinations against vendor advisories; this chapter makes no exact patched-version claim. Run dependency, bundle and browser policy checks in an approved isolated environment. Practice: design a release report with a missing bundle review and one with all gates passing; confirm the first is blocked, then explain how genuine evidence differs from a Boolean.