Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

@baseera/react

Latest version: v0.4.0

Overview

Last scanned
29 Nov 2026
Published
29 Nov 2026
npm package Publisher: jihadmb
6 Versions
692 Downloads

Scan summary

@baseera/react was last scanned on 29 Nov 2026 at version 0.4.0. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 6 versions; the latest 3 were published within 5 days (25–29 Nov 2026).
  • Findings: No rules fired in version 0.4.0.
  • Downloads: 692 downloads.

Versions

6 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.4.0 LATEST 29 Nov 2026 No rules fired
0.3.0 29 Nov 2026 No rules fired
0.2.1 25 Nov 2026 No rules fired
0.2.0 19 Nov 2026 Not shown
0.1.0 18 Nov 2026 Not shown

No rules fired in 0.4.0

Findings

Findings for v0.4.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.4.0; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

@baseera/react

React bindings for Baseera: <BaseeraProvider>, useBaseeraChat() and useBaseeraTool(). They work in React 18 and 19, in Next.js App Router and in Vite. The built files start with "use client", so they can be imported from a client component in the App Router, as below.

pnpm add @baseera/react

Quick start: Next.js App Router

Your server signs the user token (signUserToken from @baseera/node) in a route handler such as app/api/baseera-token/route.ts. Then wrap the app in a client component:

// app/providers.tsx
"use client";
import { BaseeraProvider } from "@baseera/react";

export function Providers({ children }: { children: React.ReactNode }) {
  return (
    <BaseeraProvider
      publishableKey={process.env.NEXT_PUBLIC_BASEERA_KEY!}
      baseUrl={process.env.NEXT_PUBLIC_BASEERA_URL!}
      getUserToken={() => fetch("/api/baseera-token").then((r) => r.text())}
      theme="system"
    >
      {children}
    </BaseeraProvider>
  );
}
// app/layout.tsx (a server component)
import { Providers } from "./providers";

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en">
      <body><Providers>{children}</Providers></body>
    </html>
  );
}

Quick start: Vite

// src/main.tsx
import { createRoot } from "react-dom/client";
import { BaseeraProvider } from "@baseera/react";
import { App } from "./App";

createRoot(document.getElementById("root")!).render(
  <BaseeraProvider
    publishableKey={import.meta.env.VITE_BASEERA_KEY}
    baseUrl={import.meta.env.VITE_BASEERA_URL}
    getUserToken={() => fetch("/api/baseera-token").then((r) => r.text())}
  >
    <App />
  </BaseeraProvider>,
);

Only a publishable key (pk_…) belongs in browser code. baseUrl is required until a hosted runtime exists. getUserToken can be omitted only for dev-mode agents on localhost. Nothing touches window during render, so server rendering is safe; the session id lives in sessionStorage (when it is available) so a reload resumes the conversation.

useBaseeraChat

import { useBaseeraChat } from "@baseera/react";

export function Chat() {
  const { messages, status, error, send, stop, pendingApprovals, approve, reject } = useBaseeraChat();

  return (
    <div>
      {messages.map((m) =>
        m.role === "user" ? (
          <p key={m.id}><b>You:</b> {m.text}</p>
        ) : (
          <div key={m.id}>
            {m.toolCalls.map((c) => c.status === "running" && <em key={c.callId}>Checking {c.name}…</em>)}
            <p>{m.text}</p>
          </div>
        ),
      )}

      {pendingApprovals.map((a) => (
        <div key={a.callId} role="group" aria-label="Approval needed">
          <p>{a.description}</p>
          <button onClick={() => approve(a.callId)}>Approve</button>
          <button onClick={() => reject(a.callId, "Not now")}>Reject</button>
        </div>
      ))}

      {status === "error" && <p role="alert">Something went wrong ({error?.code}).</p>}
      {status !== "idle" && status !== "error" && <button onClick={stop}>Stop</button>}
      <form onSubmit={(e) => { e.preventDefault(); const input = e.currentTarget.elements.namedItem("q") as HTMLInputElement; void send(input.value); input.value = ""; }}>
        <input name="q" /> <button disabled={status !== "idle" && status !== "error"}>Send</button>
      </form>
    </div>
  );
}

It returns { messages, status, error, pendingApprovals, send, stop, reset, approve, reject, undo }.

  • status: idle, streaming, awaiting_approval, running_tool or error. send is ignored while it is anything but idle or error.
  • Assistant messages have toolCalls. A call's status is pending, awaiting_approval, running, done, failed, rejected or timed_out, so the UI can show "Checking invoices…" while one is running.
  • Draft and write tools wait in pendingApprovals ({ callId, name, kind, input, description }) until approve or reject. description comes from the tool's describe(input), else the name and the input as JSON, cut at 300 characters.
  • error is a BaseeraError with a stable code; show your own text to end users.

useBaseeraTool

Defines a tool the model can call, backed by your component's data and handlers. zod (v4) is a peer dependency: pnpm add zod.

import { useBaseeraTool } from "@baseera/react";
import { z } from "zod";

function InvoicePage({ invoice, api }: Props) {
  // read: runs at once
  useBaseeraTool({
    name: "getInvoice",
    description: "Get an invoice by its number",
    kind: "read",
    input: z.object({ number: z.string() }),
    run: ({ number }) => api.getInvoice(number),
  });

  // draft: waits for the user's approval
  useBaseeraTool({
    name: "draftReminder",
    description: "Draft a payment reminder email for an invoice",
    kind: "draft",
    input: z.object({ number: z.string(), tone: z.enum(["friendly", "firm"]).default("friendly") }),
    describe: ({ number, tone }) => `Draft a ${tone} reminder for invoice ${number}`,
    run: ({ number, tone }) => api.draftReminder(number, tone),
  });

  // write: waits for the user's approval
  useBaseeraTool({
    name: "markInvoicePaid",
    description: "Mark an invoice as paid",
    kind: "write",
    input: z.object({ number: z.string(), paidOn: z.string().date() }),
    describe: ({ number, paidOn }) => `Mark invoice ${number} as paid on ${paidOn}`,
    run: async ({ number, paidOn }) => {
      await api.markPaid(number, paidOn);
      return { ok: true };
    },
  });
  return null;
}
  • input must be a z.object(...). It is converted to JSON Schema for the model (the top-level $schema key is dropped) and must stay under 16,000 bytes.
  • name is 1 to 64 letters, digits, _, . or -; description is 1 to 2,000 characters. A bad definition throws when the component renders.
  • The model's input is checked with the schema before run (and before an approval is asked). If it is invalid, run is not called and the model gets a short error listing what is wrong, so it can correct itself. run receives the parsed value, so defaults and coercions are applied.
  • run can return anything JSON-serializable. A thrown error goes back to the model as a tool error.
  • describe(input) is the sentence the user sees when approving a draft or write call (pendingApprovals[].description, see GNA-24).
  • The tool is registered while the component is mounted and sent with every turn. The latest run and describe are used, so re-renders don't re-register; changing name, kind, description or the schema does. Define the schema outside the component (or memoize it) so it keeps its identity.
  • Registering a name twice logs a console.warn with the name; the latest registration wins, and when it unmounts the earlier one is back.
useBaseeraToolDefinition (low-level)

The primitive under useBaseeraTool, for tools that don't use Zod. It takes a RegisteredTool ({ spec, run, validate?, describe? }, where spec.inputSchema is JSON Schema) and re-registers only when spec.name changes.

useBaseeraContext

Tells the agent where the user is, so "mark this paid" means the invoice on screen. The context goes with every turn (the message and the tool results that continue it) and fills the {{page}} and {{entity.*}} variables in the agent's prompt.

import { useBaseeraContext } from "@baseera/react";

function InvoicePage({ invoice }: { invoice: Invoice }) {
  useBaseeraContext({
    page: `/invoices/${invoice.id}`,
    entity: { type: "invoice", ref: invoice.id, title: invoice.number },
    data: { status: invoice.status, total: invoice.total, currency: invoice.currency },
  });
  return <InvoiceView invoice={invoice} />;
}
  • The context applies while the component is mounted and is removed on unmount. Values are compared by content, so inline objects are fine.
  • Nested calls merge, outer first. The innermost page wins. The innermost entity wins as a whole (fields of two entities are never mixed). data is shallow-merged, inner keys win.
  • send(text, { context }) overrides for one call, merged on top of the page context.
  • Limits (the runtime refuses a turn that breaks them, so the SDK enforces them first): page, entity.type, entity.ref and entity.title are cut to 200 characters. data is at most 4096 bytes serialized; if it is larger, data is left out of that turn and a warning (byte size and limit, never the data) is logged once in development.
  • Everything in data is sent to the model provider. Send only what the agent needs, and never secrets.

Immersive mode

Immersive mode is for the one record your users spend their day in, such as an invoice. While the screen is mounted, the agent sees the record's fields and the results of your checks with every turn, and your UI can block the finish button while something serious is open. The checks run in your app; nothing is sent to the agent except their results.

import { useBaseeraImmersive, useBaseeraImmersiveState } from "@baseera/react";

const ok = () => ({ ok: true }) as const;

function InvoiceScreen({ invoice, form }: { invoice: Invoice; form: InvoiceForm }) {
  useBaseeraImmersive({
    entity: { type: "invoice", ref: invoice.id, title: invoice.number },
    fields: [
      { name: "customer", label: { ar: "العميل", en: "Customer" }, kind: "text", get: () => form.customer },
      { name: "dueDate", label: { ar: "تاريخ الاستحقاق", en: "Due date" }, kind: "date", get: () => form.dueDate },
      { name: "taxId", label: { ar: "الرقم الضريبي", en: "Tax ID" }, kind: "text", get: () => form.taxId },
      { name: "total", label: { ar: "المجموع", en: "Total" }, kind: "number", get: () => form.total },
    ],
    checks: [
      {
        id: "tax-id-missing",
        severity: "blocking",
        fields: ["taxId"],
        run: (r) =>
          r.taxId
            ? ok()
            : {
                ok: false,
                message: "الرقم الضريبي مفقود",
                // A draft the model may propose. The user approves it before it reaches the form.
                fix: { field: "taxId", value: lookupTaxId(r.customer as string), reason: "من سجل العميل" },
              },
      },
      {
        id: "due-date-past",
        severity: "warning",
        fields: ["dueDate"],
        run: (r) => (new Date(r.dueDate as string) >= new Date() ? ok() : { ok: false, message: "تاريخ الاستحقاق في الماضي" }),
      },
    ],
    // AI checks defined on the agent in the platform, by id: the ones this screen opts into.
    aiChecks: ["policy-conflict"],
    finish: {
      label: "إرسال الفاتورة",
      closed: invoice.status === "closed", // no finish button on closed records
      action: ({ receipt }) => sendInvoice(invoice.id, receipt), // your route calls verifyFinish() from @baseera/node
      blockOnWarnings: false,
    },
  });
  return <InvoiceForm form={form} />;
}

function FinishBar() {
  const { openChecks, canFinish, finishLabel, finish, acknowledge } = useBaseeraImmersiveState();
  return (
    <footer>
      {openChecks.warning.map((c) => (
        <p key={c.id}>{c.message} <button onClick={() => acknowledge(c.id)}>Dismiss</button></p>
      ))}
      <button disabled={!canFinish} onClick={() => void finish()}>{typeof finishLabel === "string" ? finishLabel : finishLabel?.ar}</button>
    </footer>
  );
}
  • Fields. name, label (a string, or { ar, en }), kind (text, number, date, select) and get, which returns the current value. The record your checks receive is { [name]: get() }, read when they run. Values must be JSON-serializable.
  • Checks. run(record, { signals }) returns { ok: true } or { ok: false, message, fix? }. severity is blocking, warning or info. fix is a draft value for a field ({ field, value, reason? }) or a tool call the model may propose ({ tool, input }). run is synchronous. If it throws, the check counts as failed with a generic message, so a blocking check that throws keeps canFinish false.
  • When checks run. When immersive mode starts, and 250 ms after a field's value changes (values are compared as JSON on each render). Call recheck() from useBaseeraImmersiveState() after anything else changes. A result that turns passing shows as resolved in results for 3 seconds, then drops.
  • Acknowledge. acknowledge(id) hides a warning or info for this record until its result changes (same check id and message). Blocking checks can't be acknowledged: the call is ignored, with a development warning.
  • Finish. canFinish is false while a blocking check is open (or could not run), while a warning is open if blockOnWarnings is true, and when finish.closed is true. finish() first records the finish with Baseera (a single-use receipt with the open blocking checks and the override reason), and only if that worked runs your finish.action({ receipt, override }). If recording fails, the action does not run and finishError is "record_failed". With blocking checks open the person can still finish with a written reason: finish({ override: { reason } }) (10 to 1,000 characters; canOverride tells you when). The built-in surface shows this as a "Finish anyway" button. Your route must call verifyFinish from @baseera/node with the receipt; without it nothing is enforced on your server. See the @baseera/node README for what the guard does and doesn't prove.
  • AI checks. List the ids of the agent's AI checks in aiChecks. The SDK asks the runtime to run them when the record opens and, after a 1.5 s pause, when a field changes (one request at a time). Results are labelled as AI in the review panel, with the knowledge sources they relied on, and never block a finish unless the agent allows it for a blocking check (blocksFinish); then the failing check counts in openBlocking and needs an override, and the runtime enforces that itself. The runtime caches results until the field values change and caps the runs per record.
  • State. useBaseeraImmersiveState() returns openChecks by severity, results (with open, resolved and acknowledged statuses), counts, canFinish, canOverride, openBlocking, finishStatus (idle, busy, error, closed), finishError, finishLabel, pendingDrafts (values waiting for the user in a field, see Fields) and aiChecks (the latest result of each AI check this screen opted into: { id, ok, message, fields, sources, severity, blocksFinish }). It works in any component under <BaseeraProvider>.
  • One record at a time. A second call replaces the first, whether it is nested or mounted later, and logs a warning in development (record types and refs only). When the replacing component unmounts, the replaced one is not restored: immersive mode ends. A different entity.type or entity.ref on the same component starts over as a new record.
  • What is sent. Each turn carries the entity, the fields (label, kind, value) and every check's severity, pass or fail, message and fields. Values over 2 KB are cut, at most 50 fields and 100 checks are sent, and the whole object stays under 16 KB (field values are dropped first). Everything sent goes to the model provider, so don't declare fields holding secrets. See PROTOCOL.md.
  • applyCheckFix(checkId) (from useBaseeraImmersiveState()) proposes an open check's fix: { field, value } as a draft in the field, for an "Apply fix" button. It resolves with the user's decision, or null when there is nothing to show (no open check with a field fix, or the field isn't on the screen).
  • The state machine lives in @baseera/core (createImmersiveController), so other frameworks can reuse it.
Signals

useBaseeraSignal() returns signal(name, data?). Call it when something happens in your UI that a check may depend on, such as a document being uploaded:

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm @baseera/react

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Ethersphere Hijacked With Crypto Stealing Malware (1)
npm

Ethersphere Hijacked With Crypto Stealing Malware Via Github & npm

PolinRider Returns
Research

PolinRider Returns: Hijacked npm Packages Use Ethereum Blockchain to Conceal Malware Infrastructure

Critical Apache HTTP Server Flaw Exposes Web Servers to RCE (1)
CVE

CVE-2026-119618: Critical Apache HTTP Server Flaw Exposes Web Servers to Remote Code Execution

Frame 2085668439 (1)
Group 1261154229