# Switch projects without a rebuild

URL: https://docs.analytics.remcostoeten.nl/docs/tutorial/switch-projects

> Step 7 of 7. Move the connection settings from build-time variables into a settings bar kept in localStorage.

The settings come from `.env.local`, so another project means another build. This last step adds a settings bar for the API, the project, a read token and a public key, and keeps them in `localStorage`. The result is the [example dashboard](https://docs.analytics.remcostoeten.nl/examples/dashboard) as it is in the repository.

## 1. Add the settings bar

<StepDiff
  step="7"
  notes="[
  {
    file: &#x22;src/settings.ts&#x22;,
    match: &#x22;export function useSettings&#x22;,
    text: &#x22;The variables from .env.local are now only the defaults. Whatever someone types in the bar wins and is saved in this browser.&#x22;,
  },
  {
    file: &#x22;src/app.tsx&#x22;,
    match: &#x22;const connection = `${settings.endpoint}|${settings.project}|${settings.token}`&#x22;,
    text: &#x22;A new connection builds a new client and scope, and every panel reads again.&#x22;,
  },
  {
    file: &#x22;src/components/settings-bar.tsx&#x22;,
    match: 'type={field.secret ? &#x22;password&#x22; : &#x22;text&#x22;}',
    text: &#x22;Tokens are hidden on screen, but they are still in this browser's storage. Use a read-only token and only on your own machine.&#x22;,
  },
]"
/>

## 2. Run the finished example

The finished app is in the repository, with tests for the URL state and the read hook:

```bash
git clone https://github.com/remcostoeten/analytics
cd analytics && bun install
bun run --cwd examples/dashboard dev
```

It opens on `http://localhost:3301`. [Read client](https://docs.analytics.remcostoeten.nl/docs/sdk/read-client.md) lists every read this dashboard did not use, such as `paths`, `retention` and `lifecycle`, and [Build a minimal dashboard](https://docs.analytics.remcostoeten.nl/docs/getting-started/minimal-dashboard.md) shows the same reads from a Next.js server component.
