Registry / database / teamplay

teamplay

JSON →
library0.4.0jsnpmunverified

Teamplay is a full-stack signals ORM for multiplayer real-time applications. Current stable version is 0.4.0. It integrates with React and React Native, using signals for reactive state management and automatic synchronization with a backend. Key differentiators include its ORM-like API for managing relational data, built-in multiplayer support via WebSockets, and deep React/React Native integration. It is designed for developers building collaborative apps with minimal boilerplate, handling optimistic updates and conflict resolution. The package ships TypeScript types and requires React as a peer dependency.

npm install teamplay
INSTALL
IMPORT
SIG · TEAMPLAY
T
teamplay
databasejavascriptv0.4.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

createStore
import { createStore } from 'teamplay'
const createStore = require('teamplay')
Teamplay is ESM-only; CommonJS require() will fail.
useTeamplay
import { useTeamplay } from 'teamplay'
import { useTeamplay } from 'teamplay/react'
React hooks are exported from the main package.
Model
import { Model } from 'teamplay'
import { Model } from 'teamplay/model'
Model is a class, not a module in a subpath.

Demonstrates creating a store, defining a model, and saving an instance.

import { createStore, Model } from 'teamplay' const store = createStore() class Task extends Model { static fields = { title: String, done: Boolean } } const task = new Task({ title: 'Build something', done: false }) task.save() console.log(task.id) // e.g., 'abc123'
Debug
Known issues
breakingVersion 0.4.0 changed the API for createStore; previous versions used createStore(config) where config included a 'models' array. Now models are registered via class definition.
fix
Upgrade to 0.4.0 and define models using Model class with static fields property.
affects: <=0.3.0
deprecatedThe 'teamplay/react' subpath import is deprecated. All React hooks are now exported from the main package.
fix
Change imports from 'teamplay/react' to 'teamplay'.
affects: >=0.4.0
gotchaModels must be defined with 'static fields' property; otherwise runtime errors occur.
fix
Ensure each model class has a static fields object defining attribute types.
affects: >=0.4.0
gotchaAsyncStorage is required for persistence in React Native. Not providing it will cause store initialization to fail.
fix
Install @react-native-async-storage/async-storage and pass it to createStore({ asyncStorage: ... }).
affects: >=0.4.0
Errors
Common errors & fixes
TypeError: teamplay__WEBPACK_IMPORTED_MODULE_0___default(...).createStore is not a function
Using default import instead of named import for createStore.
fix
Use named import: import { createStore } from 'teamplay'
Model 'Task' must have a static 'fields' property.
Model class missing static fields definition.
fix
Add 'static fields = { ... }' to your model class.
Cannot find module 'teamplay/react'
Importing from deprecated subpath 'teamplay/react' in version 0.4.0.
fix
Change import to 'teamplay'.
Upgrade
Version history
0.4.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
22 hits · last 30 days
node
18
Meta
1
Amazon
1
OpenAI (training)
1
Resources
teamplay — npm install teamplay · libregistry