PolynomialHQdocs
SDKs

SDK overview

Complete reference for PolynomialHQ's browser, React, server, and protocol packages.

SDKs

PackagePrimary entry pointRuntime
@polynomialhq/clientcreateClient()Browser, or a runtime with WebSocket and fetch
@polynomialhq/reactPolynomialProviderBrowser, React 18.2+
@polynomialhq/servernew PolynomialServer()Node.js only — uses node:crypto
@polynomialhq/contractsclientWebSocketMessageSchemaAnywhere

All packages are ESM, include TypeScript declarations, and publish a single root export.

How they stack

@polynomialhq/react depends on @polynomialhq/client, which depends on @polynomialhq/contracts. Installing the React package brings the whole browser stack, and it re-exports createClient so most applications never import the client package by name.

@polynomialhq/server is independent: it shares no code with the browser packages and speaks HTTP plus token signing rather than the WebSocket protocol.

Which layer should I use?

  • Start with @polynomialhq/react for a React interface.
  • Use @polynomialhq/client for another view framework, a state adapter, or direct room access.
  • Use @polynomialhq/server for every operation involving a sk_... secret.
  • Use @polynomialhq/contracts only when implementing a protocol adapter, worker, or raw WebSocket integration.

On this page