New:Microsoft Teams Notifications Are Now Available in Socket.Learn more →
Get Started

@layers/amba-react

Package Overview
Dependencies
Maintainers
3
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@layers/amba-react

React hooks for the amba SDK — useAmba, useUser, useCollection, useFlag, and more.

latest
Source
npmnpm
Version
4.0.3
Version published
Weekly downloads
0
-100%
Maintainers
3
Weekly downloads
 
Created
Source

@layers/amba-react

Amba is the agent-native backend-as-a-service for mobile and web apps. This package is the React hooks layer — companion to @layers/amba-web.

Install

npm install @layers/amba-react@1.0.1 @layers/amba-web@1.0.1 react

Configure + first call

import { Amba } from "@layers/amba-web";
import { AmbaProvider, useUser, useCollection } from "@layers/amba-react";

// Configure once, before render.
await Amba.configure({ apiKey: import.meta.env.VITE_AMBA_API_KEY });

function App() {
  return (
    <AmbaProvider>
      <Inner />
    </AmbaProvider>
  );
}

function Inner() {
  const { user, isAuthenticated } = useUser();
  const { data: todos, loading } = useCollection<{ id: string; title: string }>(
    "todos",
  );

  if (!isAuthenticated) return <SignIn />;
  if (loading) return <Spinner />;
  return (
    <div>
      <p>Welcome {user?.display_name}</p>
      <ul>{todos?.map((t) => <li key={t.id}>{t.title}</li>)}</ul>
    </div>
  );
}

Hooks at a glance

HookReturns
useAmba()Raw SDK handle.
useUser(){ user, isAuthenticated, loading }.
useCollection(name, options){ data, loading, error, refetch, response }.
useFlag(name)boolean.
useVariant(name)string | null (multi-variant flag assignment).
useEntitlement(name)boolean — true if the user has the entitlement.
useTrackOnMount(event, props)Side effect — tracks the event on mount.

Docs

Full reference: https://docs.amba.dev/sdk/react.

License

MIT

FAQs

Package last updated on 03 Jun 2026

Related posts