---
title: Svelte Framework
slug: v4-5/js/tutorials/svelte
docTags: 
createdAt: 2023-09-14T20:29:04.100Z
---

If you're using the Svelte framework to develop your app, ensure your `ditto` instance remains accessible throughout your app by using the `writable` function from the top-most scope of your app:

1. From the top-most scope of your app, import Ditto.
2. Using async await, initialize Ditto.
3. Provide your access credentials:
   1. Replace the `appID` placeholder value with the app ID that identifies your app in Ditto.
   2. Replace the `token` placeholder value with your playground token that the Big Peer uses to verify your digital identity before issuing your playground certificate.&#x20;

```javascript
import { writable } from "svelte/store";

let ditto = writable([]);
let subscription = writable([]);

ditto.set(new Ditto(identity))
subscription.set($ditto.store.collections("cars").find("color == 'red'").subscribe())
```

