# Integration Guide

## Add floors.js to _Squarespace_

Open Settings, Advanced, Code Injection. Paste one line in the Footer field. That's it — no Squarespace app, no monthly subscription.

## How it works

floors.js loads as a lightweight script on every page of your Squarespace site. It detects each page URL and creates a room for it. Visitors on the same page see each other as 3D avatars and can chat in real-time.

Your homepage is one room, your about page is another, and each blog post gets its own room. No code, no app, no configuration — just paste one line and your site comes alive.

## Installation

Squarespace lets you inject custom code site-wide via the Code Injection panel. Here's how:

- Open your Squarespace dashboard
- Go to **Settings → Advanced → Code Injection**
- Paste the following in the **Footer** field
- Click **Save**

Paste in the Footer field:

```html
<script src="https://floorsjs.com/embed.js" data-key="flr_..."></script>
```

Replace `flr_...` with your site key from the floors.js dashboard. The script loads asynchronously and won't slow down your site.

## What visitors see

Once installed, every page on your Squarespace site becomes a room. A small widget appears in the corner showing who else is on the same page.

- **Homepage** — visitors browsing your landing page see each other
- **About page** — potential clients reading about you can chat
- **Blog posts** — each post is its own room where readers discuss
- **Store pages** — shoppers see other people browsing the same product

## Configuration

Add optional attributes to customize the experience:

```html
<script
  src="https://floorsjs.com/embed.js"
  data-key="flr_..."
  data-server="wss://your-server.com"
  data-name="Store Owner"
></script>
```

- **data-key** (required) — your site key
- **data-server** (optional) — custom WebSocket server if self-hosting
- **data-name** (optional) — pre-set a display name for the visitor

## FAQ

**Do I need a Squarespace app?**  
No. Code Injection is a built-in Squarespace feature. No app marketplace, no monthly app fee. Just paste the script and save.

**Which Squarespace plans support this?**  
Business and Commerce plans support Code Injection. Personal plans don't have this feature. You can upgrade to Business to use floors.js.

**Does it work with Squarespace's AJAX loading?**  
Yes. floors.js detects URL changes regardless of how navigation works — standard page loads, AJAX loading, or any other method Squarespace uses internally.

**Will it slow down my site?**  
No. The script loads asynchronously after your page content. It's lightweight and won't affect your Squarespace site's loading speed or SEO performance.
