@oneie/plugin-backend
v0.1.0
Published
@oneie/sdk client + React 19 hooks wired through the plugin contract
Readme
@oneie/plugin-backend
@oneie/sdk client and React 19 hooks wired through the plugin contract.
import { backend } from '@oneie/plugin-backend'
export default defineOne({
plugins: [backend()],
})Makes the ONE substrate available in API routes and React components without importing the SDK directly. Uses the ONE_API_KEY binding configured in one.config.ts.
Hooks
import { useSignals, useThing } from '@oneie/plugin-backend'
function MyComponent() {
const signals = useSignals({ type: 'message' })
const thing = useThing(id)
}What ships
backend()— plugin factoryuseSignals(filter),useThing(id),useActor(id)— React 19 hooksgetSubstrate()— server-side SDK client (API routes)
