Install stitchdb-js from npm or load it in the browser.
#npm
Terminal
npm install stitchdb-jsAlso with yarn add stitchdb-js, pnpm add stitchdb-js or bun add stitchdb-js.
JavaScript
import { createClient } from 'stitchdb-js'#Browser
Or load it straight in the browser. It exposes a global window.stitchdb:
index.html
<script src="https://stitchdb.com/sdk/stitchdb.js"></script>
<script>
const client = stitchdb.createClient('https://<project-ref>.p.stitchdb.com', '<anon-key>')
</script>#Runtimes
The SDK works in browsers, Node.js 18 and later, Deno and React Native. On React Native, pass a storage such as AsyncStorage in auth.storage.