
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
@jamsocket/react
Advanced tools
React hooks for interacting with session backends and the Jamsocket platform.
React hooks for interacting with session backends and the Jamsocket platform.
Read the docs here
npm install @jamsocket/react
Here's an example of how different parts of Jamsocket's client libraries work together.
import { Jamsocket } from '@jamsocket/server'
const jamsocket = new Jamsocket({
account: '[YOUR ACCOUNT]',
token: '[YOUR TOKEN]',
service: '[YOUR SERVICE]',
// during development, you can simply pass { dev: true }
})
const connectResponse = await jamsocket.connect() // returns an instance of ConnectResponse
import { type ConnectResponse, SessionBackendProvider, useReady } from '@jamsocket/react'
function Root() {
return(
<SessionBackendProvider connectResponse={connectResponse}>
<MyComponent sessionBackendUrl={connectResponse.url} />
</SessionBackendProvider>
)
}
function MyComponent({ sessionBackendUrl }) {
const ready = useReady()
useEffect(() => {
if (ready) {
// make a request to your session backend
fetch(sessionBackendUrl)
}
}, [ready])
return ready ? <MyChildren /> : <Spinner />
}
SessionBackendProviderWrap the root of your project with the SessionBackendProvider so that the children components can utilize the React hooks.
The SessionBackendProvider must be used in conjunction with @jamsocket/server in order to access the connect response returned by the connect function.
import { SessionBackendProvider, type ConnectResponse } from '@jamsocket/react'
export default function HomeContainer({ connectResponse }: { connectResponse: ConnectResponse }) {
return (
<SessionBackendProvider connectResponse={connectResponse}>
<Home />
</SessionBackendProvider>
)
}
useReadyIs a React hook that returns a boolean that is true if the session backend is ready.
import { useReady } from '@jamsocket/react'
const isReady = useReady()
The @jamsocket/react package also re-exports all of the @jamsocket/client and @jamsocket/types packages' exports, including classes and types.
FAQs
React hooks for interacting with session backends and the Jamsocket platform.
We found that @jamsocket/react demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

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.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.