npm install @proma-dev/sdkAuth
OAuth 2.1 + PKCE. Hosted accounts. Tenant isolation via Postgres RLS — you never write auth code again.
AI gateway
One client, every model. Proma meters credits per outcome, splits revenue, and pays you out — no Stripe wiring.
User management
Invite teammates, mention people with @, group them with #. Permissions, roles, and audit trails included.
Notifications
Trigger transactional emails and in-app alerts from one endpoint. Customizable templates included — no Resend or Postmark to integrate.
~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.Spin up an OAuth client, drop in the SDK, ship a managed AI app this afternoon.