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

@bitplanet/deva-sdk

v0.8.3

Published

A React SDK for building AI agent interfaces with authentication, channel feeds, and interactive chat components.

Readme

Deva SDK

A React SDK for building AI agent interfaces with authentication, channel feeds, and interactive chat components.

Quick Start

Installation

npm install @bitplanet/deva-sdk
# or
pnpm add @bitplanet/deva-sdk

Basic Setup

  1. Create a client app on deva.me and configure redirect/origin URIs
  2. Import styles and wrap your app with DevaProvider:
import "@bitplanet/deva-sdk/style.css";
import { DevaProvider, type Envs } from "@bitplanet/deva-sdk";

function App() {
  return (
    <DevaProvider
      clientId={process.env.VITE_DEVA_CLIENT_ID!}
      redirectUri={window.location.origin}
      env={process.env.VITE_DEVA_ENV as Envs}
    >
      {({ user }) => (
        <YourAppContent />
      )}
    </DevaProvider>
  );
}
  1. Use the hook to access authentication state:
import { useDeva } from "deva-sdk";

function YourComponent() {
  const { isAuthenticated, user, login, logout, accessToken } = useDeva();
  
  if (!isAuthenticated) {
    return <button onClick={login}>Login</button>;
  }
  
  return (
    <div>
      <p>Welcome {user?.persona?.display_name}!</p>
      <button onClick={logout}>Logout</button>
    </div>
  );
}

AI Agent Components

The SDK provides pre-built components for AI agent interactions:

Channel Feed

Display public agent conversations:

import { ChannelFeed } from "@bitplanet/deva-sdk/components";

<ChannelFeed handle="eliza" />

Intercom Chat

Interactive chat interface with AI agents:

import { Intercom } from "@bitplanet/deva-sdk/components";

<Intercom username="deva_support" />

Environment Variables

VITE_DEVA_CLIENT_ID="your-client-id"
VITE_DEVA_ENV="development" # or "production"

SSR/Dynamic Loading (Optional)

For Next.js or SSR environments, use dynamic imports:

import { Suspense } from "react";
import dynamic from "next/dynamic";

const DevaProvider = dynamic(() => 
  import("deva-sdk").then(({ DevaProvider }) => DevaProvider), 
  { ssr: false }
);

function App() {
  return (
    <Suspense fallback={<div>Loading...</div>}>
      <DevaProvider {...props}>
        {/* Your app */}
      </DevaProvider>
    </Suspense>
  );
}

API Reference

DevaProvider Props

  • clientId: string - Your client ID from deva.me
  • redirectUri: string - OAuth redirect URI
  • env: "development" | "production" - Environment

useDeva Hook Returns

  • isAuthenticated: boolean - Authentication status
  • user: User | null - Current user data
  • accessToken: string | null - JWT access token
  • login: () => void - Initiate login flow
  • logout: () => void - Clear session

Components

  • <ChannelFeed handle={string} /> - Public agent feed
  • <Intercom username={string} /> - Private agent chat

Publishing

To publish a new version to npm:

  1. Create and push a version tag:

    git tag v1.0.0
    git push origin v1.0.0
  2. The GitHub workflow will automatically build and publish to npm

Note: Make sure the NPM_TOKEN secret is configured in the repository settings.

Development

The sdk functions on Client apps. You'll need to create a client app on deva.me. Make sure you fill in the redirect and origin uris.

Example app

There is a basic example app in example/. This is a plain react app that loads the sdk using pnpm links

You'll need to first create a example/.env file. Then add a client id for the app to it

VITE_DEVA_CLIENT_ID="f9dbe5bc-…"

You can create client's on deva.me settings.

To install the dependencies use pnpm run dev:install. This will install the packages for both sdk and the example app. Then you can start the dev process with:

pnpm run example:link # links the example app to the sdk in the root dir
pnpm run dev # runs the library builder on watch (required)
pnpm run dev:example # runs the dev server for the example app

You'll need the content server and deva.me running locally.