# Supporting both Vitrin and Legacy themes


:::warning[This page is for JS app developers]
If you are developing a new theme you wil only be using the new SDK which is detailed in the next pages
:::

## Detecting Vitrin at runtime
To ensure you JS apps work on both Vitrin and legacy themes, you can use the `windows.vitrin` object. It will be set to `true` only if the store is running vitrin.

Example:
```js
var has_vitrin = window.vitrin == true;

if (has_vitrin) {
  var cart = zid.cart.get();
} else {
  var cart = zid.store.cart.fetch();
}
```

## Alternative for remote scripts (via query param)

If you host a remote script that already uses query params, you’ll now receive `?vitrin=true` when the store is on Vitrin. You can serve a newer script version without checking window.vitrin in the script itself.


New:
```
{script_url}?store={store_uuid}&vitrin=true
```

Legacy:
```
{script_url}?store={store_uuid}
```

