🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@geometra/client

Package Overview
Dependencies
Maintainers
1
Versions
128
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@geometra/client

Thin client that receives server-computed geometry and paints via renderer

latest
Source
npmnpm
Version
1.63.0
Version published
Maintainers
1
Created
Source

@geometra/client

Thin WebSocket client (~2KB) for Geometra. Connects to a Geometra server and renders streamed layouts on a canvas.

Install

npm install @geometra/client

Key exports

  • createClient — WebSocket client connected to a Geometra server
  • applyServerMessage — apply a parsed server message to renderer state (advanced/testing)
  • binaryFraming option — negotiate optional binary GEOM envelopes (same JSON as text frames)

Usage

import { createClient } from '@geometra/client'
import { CanvasRenderer } from '@geometra/renderer-canvas'

const canvas = document.getElementById('app') as HTMLCanvasElement
const client = createClient({
  url: 'ws://localhost:3000',
  renderer: new CanvasRenderer({ canvas }),
  canvas,
  // forwards pointer + keyboard + IME composition events to server
  forwardKeyboard: true,
  forwardComposition: true,
  // optional telemetry hook for decode/apply/render budget tracking
  onFrameMetrics: (m) => {
    console.log('frame metrics', m.messageType, m.decodeMs, m.applyMs, m.renderMs)
  },
  // optional: observe closes; auth failures use WebSocket code 4001 and do not auto-reconnect
  onClose: (ev) => {
    if (ev.code === 4001) console.log('auth rejected')
  },
})

Auth with @geometra/auth is documented in the main repo: PLATFORM_AUTH.md.

Keywords

textura

FAQs

Package last updated on 06 Jun 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts