npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@raucheacho/konet-rn

v0.5.0

Published

React Native client for Konet realtime infrastructure

Downloads

116

Readme

@raucheacho/konet-rn

React Native client for Konet, the self-hosted realtime engine (channels, presence, broadcast).

A thin layer over @raucheacho/konet-js: the protocol is implemented once, in the core, and this package adds the one thing React Native needs on top of it — reacting to the app lifecycle.

Install

npm install @raucheacho/konet-js @raucheacho/konet-rn

The core is a peer dependency, so there is a single copy of the protocol at runtime and core fixes apply without republishing this package.

Konet releases every package in lockstep from a single git tag, so install both at the same version. The peer range is deliberately >= rather than a caret: ^0.2.0 would reject the 0.3.0 core that ships alongside a 0.3.0 of this package.

No native module and no linking step: React Native provides the WebSocket global the core builds on.

Usage

import { createNativeClient } from '@raucheacho/konet-rn'

const client = createNativeClient('wss://konet.example.com/socket', {
  token: session.konetToken,
})

const map = client.channel('room:team-42:map')
await map.subscribe()

map.on('pos', (p) => updateMarker(p))
map.send('pos', { lat, lng, ts: Date.now() })

Everything else — channels, presence, send errors, options — is the core API. See the core README.

What this package adds

React Native suspends timers while an app is backgrounded. An app can come back to the foreground believing it is connected long after the server timed the socket out at 45s, because no close event ever fired in the frozen process.

KonetNativeClient subscribes to AppState and calls the core's checkConnection() on every return to the foreground, which probes the socket and reconnects if the probe goes unanswered. Channels are re-joined automatically by the core.

That is the entire delta. If you already manage the lifecycle yourself, use KonetClient from the core directly and call checkConnection() where it fits.

Background execution

Keeping a socket alive while the app is backgrounded is an app-level concern, not an SDK one, and the platforms differ sharply:

  • Android — a foreground service keeps the process (and the socket) alive. Declare the service types you actually use (location, microphone), plus FOREGROUND_SERVICE_MICROPHONE on Android 14+.
  • iOS — the OS suspends the app a few seconds after backgrounding and there is no general-purpose exemption for holding a socket open. Waking on incoming data requires a push: the PushToTalk framework (iOS 16+, needs the com.apple.developer.push-to-talk entitlement) for walkie-talkie apps, or PushKit + CallKit for call-shaped ones.

This SDK's job is to recover cleanly once your app runs again, which it does.

Options

interface KonetNativeClientOptions extends KonetClientOptions {
  appState?: AppStateLike | null   // override or disable AppState wiring
}

appState defaults to React Native's AppState. Pass null to opt out of foreground checks; pass your own implementation to drive the client from a different lifecycle source (or in tests).

License

MIT