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

@layers/amba-web

v2.0.4

Published

amba SDK for browser apps — full 25-namespace surface (auth, collections, storage, events, push, entitlements, ai, config, flags, achievements, challenges, currencies, friends, groups, leaderboards, messaging, and more).

Readme

@layers/amba-web

npm

Amba is the agent-native backend-as-a-service for mobile and web apps. This package is the browser SDK.

Full parity with the cross-language Amba surface: auth · collections · storage · events · push · entitlements · AI · config · flags · achievements · challenges · currencies · friends · groups · inventory · leaderboards · messaging · moderation · onboarding · referrals · reviews · roles · sessions · streaks · stores · sync · xp.

Install

npm install @layers/[email protected]

(pnpm add and yarn add also work.)

Configure + first call

import { Amba } from "@layers/amba-web";

await Amba.configure({
  apiKey: import.meta.env.VITE_AMBA_API_KEY,
});

await Amba.auth.signInAnonymously();
await Amba.events.track("app_opened", { source: "deep_link" });

Read or write a typed collection — rows are automatically scoped to the signed-in user:

const { data: todos } = await Amba.collections.find("todos", {
  filter: Amba.collections.where.eq("done", false),
  order: [{ column: "created_at", direction: "desc" }],
  limit: 50,
});

await Amba.collections.insert("todos", {
  title: "Ship the SDK",
  done: false,
});

Schedule it daily, fetch with getToday

Schedule a content library agentically (via MCP), then read today's selection from the SDK:

// Agent-side (one-time setup via MCP)
//   amba_content_libraries_create({ project_id, name: "Daily Tips" })
//   amba_content_items_add({ project_id, library_id, items: [...] })
//   amba_content_schedules_create({
//     project_id, library_id, name: "Daily rotation",
//     schedule_type: "daily_rotation",
//   })

// In-app (every session)
const todayTip = await Amba.content.getToday("Daily Tips");
console.log(todayTip.body);

getToday(libraryName) returns the item the schedule rotated in for the current period — segment-aware where the schedule is targeted.

Streaks — define once, qualify per user action

Define a streak once via MCP (amba_streaks_create — usually from your dev shell or admin tool), then call qualify from your app on every qualifying user action:

const streak = await Amba.streaks.qualify("daily_play");

// streak.current_count     — current consecutive count
// streak.longest_count     — personal best
// streak.status            — 'active' | 'broken' | 'frozen'
// streak.freezes_remaining — unused shields (auto-granted, configurable)

If the streak hasn't been defined yet, the call throws with error.code === 'STREAK_NOT_DEFINED' — that's a config-time error, never a runtime one. Full guide: https://docs.amba.dev/streaks.

Messaging — 1:1 conversations

The full messaging surface — createConversation, getConversations, listConversations, sendMessage, listMessages, markRead — ships as SDK helpers in 1.0.3+. No REST fallback needed.

// Create a conversation. For `type: "direct"` between two users,
// the call is idempotent — calling it again returns the existing row.
const conv = await Amba.messaging.createConversation({
  participant_ids: [otherUserId],
  type: "direct",
});

// Send a message — conversation_id is a path arg, not a body field
const msg = await Amba.messaging.sendMessage(conv.id, {
  body: "hey, want to start a daily streak together?",
});

// List the user's conversations
const inbox = await Amba.messaging.getConversations();

// Page through messages in a conversation
const messages = await Amba.messaging.listMessages(conv.id, { limit: 50 });

// Mark the conversation as read once the user has scrolled it
await Amba.messaging.markRead(conv.id);

Typed errors on every endpoint: branch on error.code for USER_NOT_FOUND, INVALID_PAYLOAD, CONVERSATION_NOT_FOUND, NOT_A_PARTICIPANT. Full guide: https://docs.amba.dev/social/messaging.

Bundle size

≤30 KB gzipped for the entry point. The shared runtime loads lazily on first call.

Docs

Full reference (auth, collections, storage, push, AI, flags, …): https://docs.amba.dev/sdk/web.

License

MIT