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

@proma-dev/sdk

v0.4.0

Published

Connect your app to the Proma marketplace — auth, credits, and AI in a few lines of code

Downloads

812

Readme

@proma-dev/sdk

Connect your app to the Proma marketplace. Authenticate users, charge credits, and use AI — all with a few lines of code.

Install

npm install @proma-dev/sdk

Setup

  1. Create an app at proma.dev/home/developer
  2. Copy your Client ID and register a Redirect URI
  3. Initialize the client:
import { PromaClient } from '@proma-dev/sdk';

const proma = new PromaClient({
  clientId: 'your_client_id',
  redirectUri: 'https://yourapp.com/callback',
  scopes: ['profile', 'credits', 'ai:chat'],
});

Authentication

// Redirect user to Proma login
await proma.login();

// On your callback page, exchange the code for a session
const session = await proma.handleCallback();

// Get the logged-in user
const user = await proma.getUser();
// => { sub, email, name, picture }

// Check auth status
await proma.isAuthenticated(); // true

// Log out
proma.logout();

Credits

Charge users for features in your app. 1,000,000 micro-credits = $1.00.

// Check balance
const { balance, formatted } = await proma.credits.getBalance();
console.log(`Balance: ${formatted}`); // "Balance: $1.23"

// Spend credits
const result = await proma.credits.spend(500_000, 'Generated a report');
// => { success: true, amount_spent: 500000, new_balance: 730000 }

AI Chat

Stream AI responses through Proma's gateway. Credits are deducted automatically per token.

// Get the full response as text
const answer = await proma.ai.chatText([
  { role: 'user', content: 'Explain quantum entanglement simply.' },
]);

// Or get a streaming Response for real-time UI
const stream = await proma.ai.chat([
  { role: 'user', content: 'Write a haiku about coding.' },
]);

React

npm install @proma-dev/sdk react

Provider

Wrap your app with PromaProvider to enable auth context:

import { PromaProvider } from '@proma-dev/sdk/react';

function App() {
  return (
    <PromaProvider
      clientId="your_client_id"
      redirectUri="https://yourapp.com/callback"
      scopes={['profile', 'credits']}
    >
      <YourApp />
    </PromaProvider>
  );
}

Hook

import { usePromaAuth } from '@proma-dev/sdk/react';

function Dashboard() {
  const { user, isLoading, isAuthenticated, login, logout, client } =
    usePromaAuth();

  if (isLoading) return <p>Loading...</p>;
  if (!isAuthenticated) return <button onClick={() => login()}>Log in</button>;

  return (
    <div>
      <p>Welcome, {user.name ?? user.email}</p>
      <button onClick={logout}>Log out</button>
    </div>
  );
}

Login Button

Drop-in button component:

import { LoginWithProma } from '@proma-dev/sdk/react';

<LoginWithProma
  clientId="your_client_id"
  redirectUri="https://yourapp.com/callback"
  scopes={['profile', 'credits']}
/>;

API Reference

| Method | Description | | --- | --- | | proma.login(scopes?) | Redirect to Proma login | | proma.handleCallback(url?) | Exchange OAuth code for session | | proma.getSession() | Get current session (auto-refreshes) | | proma.isAuthenticated() | Check if user has valid session | | proma.getUser() | Fetch user profile | | proma.logout() | Clear local session | | proma.credits.getBalance() | Get credit balance | | proma.credits.spend(amount, description?) | Deduct credits | | proma.ai.chat(messages) | Streaming AI chat | | proma.ai.chatText(messages) | AI chat (full text) |

License

MIT