npm install @proma-dev/sdkOne package. Auth, credits, AI calls, and React hooks in the same install. Zero infrastructure to run.
~6
lines to login
0
servers to run
< 5 min
install → first call
OAuth 2.1
standard, not magic
import {
PromaProvider,
usePromaAuth,
useOAuthCallback,
} from '@proma-dev/sdk/react'
// 1. Wrap once. Auth + billing wired up.
<PromaProvider
clientId={process.env.NEXT_PUBLIC_PROMA_CLIENT_ID!}
redirectUri="https://yourapp.com/callback"
scopes={['profile', 'credits', 'ai:chat']}
>
<App />
</PromaProvider>
// 2. Use anywhere.
function Composer() {
const { user, login, client } = usePromaAuth()
if (!user) return <button onClick={() => login()}>Sign in</button>
const reply = await client.ai.chatText([
{ role: 'user', content: 'Pitch this in one sentence.' },
])
// → user is charged. you earn. no servers, no Stripe.
}import { PromaClient } from '@proma-dev/sdk'
const proma = new PromaClient({
clientId: process.env.PROMA_CLIENT_ID!,
redirectUri: 'https://yourapp.com/callback',
})
// OAuth 2.1 + PKCE. Standard. No vendor lock-in.
const session = await proma.handleCallback(window.location.href)
const balance = await proma.credits.getBalance()
const text = await proma.ai.chatText([
{ role: 'user', content: 'Summarize this PR.' },
])# No SDK? No problem. It's just HTTP + OAuth.
curl https://api.proma.dev/v1/ai/chat \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"messages": [{"role": "user", "content": "Hello"}]
}'
# {
# "id": "msg_01J...",
# "model": "gemini-2.5-flash",
# "credits_charged": 1,
# "content": "Hi! How can I help?"
# }// In your Lovable project: paste this prompt.
//
// > Add "Login with Proma" using @proma-dev/sdk/react.
// > Wrap App with <PromaProvider clientId="..." />,
// > add a /callback route that calls useOAuthCallback,
// > and gate features on usePromaAuth().user.
//
// That's it. Lovable wires the SDK. You ship.Everything you would otherwise spend a quarter rebuilding is already in the SDK. Ship the part nobody else can.
We manage
You write
Built for engineers
Strict types, zero-config, tree-shakeable. Works in any bundler — Next.js, Vite, Remix, plain Node. React hooks ship in the same package.
Standards, not magic. Public-client PKCE flow means no client secret in the browser. Tokens auto-refresh. You read the IETF RFC, not our docs.
Every AI call deducts user credits. Pricing returned on every response. You earn a share on every call. No invoicing, no Stripe webhooks.
The SDK is a thin wrapper. Every endpoint is documented REST, every error is an RFC 7807 problem document. Integrate from any language.
We run Supabase Auth, MFA, password reset, and account deletion. Postgres row-level security enforces tenant isolation. You write business logic.
Publish once, get distribution to every Proma user. AI-ranked search puts your app in front of the right intent. No app review committee.
Build with your favorite tools
Spin up an OAuth client, drop in the SDK, ship a managed AI app this afternoon.