Skip to main content
The Svelte package we provide is designed for Svelte 5. If you are interested in support for Svelte 4, please contact us

Initializing a project

If you have not set up a project yet, you can easily initialize a ShadCN-Svelte / Svelte.js project by following the instructions here Or if you prefer not to use ShadCN-Svelte:

Overview

The logic of the websocket chat is handled by a Context provider. You can install it with this command:
We support multiple project setups out of the box.

Using ShadCN

After you have installed the provider, copy this component into your ShadCN project:
chat.svelte
You can then use the component inside the MagmaChatProvider from the svelte-obsidian package you installed earlier:
+page.svelte

Using TailwindCSS

This example assumes you have background and foreground tailwind color variables defined
After you have installed the provider, copy this component into your TailwindCSS project:
chat.svelte
You can then use the component inside the MagmaChatProvider from the svelte-obsidian package you installed earlier:
+page.svelte

Using CSS Modules

This example assumes you have background and foreground css color variables defined
After you have installed the provider, copy this component into your CSS Modules project:
chat.svelte
Also copy the corresponding styles:
chat.module.css
You can then use the component inside the MagmaChatProvider from the svelte-obsidian package you installed earlier:
+page.svelte