Skip to main content

Fluid Framework

Empower collaborative innovation with Fluid Framework's seamless, high-performance tech stack for real-time applications.

Key Features

Start building with Fluid Framework

Easy to use

Easy to use

Transform your collaborative experience with our developer friendly framework - where simplicity meets powerful functionality effortlessly. The framework provides usability that drives innovation within Microsoft and across the industry by dramatically lowering the difficulty and cost of building innovative, collaborative software.

Open source

Open Source

We believe that an open, inclusive, and respectful community will help shape a better future for this project. That's why Fluid Framework is made available for FREE as an Open Source project under the MIT license.

Industry-leading speed and performance

Industry-leading speed & performance

Unleash unparalleled speed and performance with our cutting-edge solution for building real-time collaborative applications. Collaborative features are only successful if they are fast, scale to large data and user bases. Fluid offers an approachable programming model that leverages mainstream web technology while delivering best-in-class performance.

Who's using Fluid Framework

Learn more
Learn more
Learn more
Learn more
Learn more
Learn more

Open Source

See how it works

Sample Code
import { SharedTree, TreeViewConfiguration, SchemaFactory, Tree } from "fluid-framework";
import { TinyliciousClient } from "@fluidframework/tinylicious-client";

const client = new TinyliciousClient();
const containerSchema = {
initialObjects: { diceTree: SharedTree },
};

const root = document.getElementById("content");

// The string passed to the SchemaFactory should be unique
const sf = new SchemaFactory("fluidHelloWorldSample");

// Here we define an object we'll use in the schema, a Dice.
class Dice extends sf.object("Dice", {
value: sf.number,
}) {}

// Here we define the tree schema, which has a single Dice object starting at 1.
// We'll call viewWith() on the SharedTree using this schema, which will give us a tree view to work with.
// The createContainer call includes the parameter "2" which indicates the version of FluidFramework that
// the data in the container is compatible with. For this example, we are using version "2".
// If the tree is new, we'll initialize it with a Dice object with a value of 1.
const treeViewConfiguration = new TreeViewConfiguration({ schema: Dice });

const createNewDice = async () => {
const { container } = await client.createContainer(containerSchema, "2");
const dice = container.initialObjects.diceTree.viewWith(treeViewConfiguration);
dice.initialize(new Dice({ value: 1 }));
const id = await container.attach();
renderDiceRoller(dice.root, root);
return id;
};

const loadExistingDice = async (id) => {
const { container } = await client.getContainer(id, containerSchema, "2");
const dice = container.initialObjects.diceTree.viewWith(treeViewConfiguration);
renderDiceRoller(dice.root, root);
};

async function start() {
if (location.hash) {
await loadExistingDice(location.hash.substring(1));
} else {
const id = await createNewDice();
location.hash = id;
}
}

start().catch((error) => console.error(error));

// Define the view
const template = document.createElement("template");

template.innerHTML = `
<style>
.wrapper { display: flex; flex-direction: column; align-items: center; }
.dice { width: 200px; }
.rollButton { width: 118px; height: 48px; background: #0078D4; border-style: none; border-radius: 8px; }
.rollText { font-size: 20px; color: #FFFFFF; }
</style>
<div class="wrapper">
<img class="dice"/>
<button class="rollButton"><span class="rollText">Roll</span></button>
</div>
`;

const renderDiceRoller = (dice, elem) => {
elem.appendChild(template.content.cloneNode(true));

const rollButton = elem.querySelector(".rollButton");
const diceElem = elem.querySelector(".dice");

// Set the value at our dataKey with a random number between 1 and 6.
rollButton.onclick = () => {
dice.value = Math.floor(Math.random() * 6) + 1;
};

// Get the current value of the shared data to update the view whenever it changes.
const updateDice = () => {
const diceValue = dice.value;
diceElem.src = `/images/dice-${diceValue}.png`;
diceElem.alt = diceValue.toString();
};
updateDice();

// Use the changed event to trigger the rerender whenever the value changes.
Tree.on(dice, "nodeChanged", updateDice);
// Setting "fluidStarted" is just for our test automation
window.fluidStarted = true;
};
Sample Output
http://localhost:8080#1734481458203
Dice showing 1
http://localhost:8080#1734481458203
Dice showing 1

Fluid Framework in the Cloud

Fluid architecture diagram
Azure Fluid Relay
Azure Fluid Relay is a cloud service that enables real-time collaboration on shared data models. It is a fully managed service that provides a secure, scalable, and reliable way to connect clients to each other and to the data models they share.
Learn more
SharePoint Embedded
Microsoft SharePoint Embedded is a cloud-based file and document management system suitable for use in any application. It is a new API-only solution which enables app developers to harness the power of the Microsoft 365 file and document storage platform for any app, and is suitable for enterprises building line of business applications and ISVs building multi-tenant applications.
Learn more