@agentlogin/rp package supplies the sign-in form and protocol handlers. Your
application supplies accounts, shared sessions, and business permissions. The
PostgreSQL callback adapter makes callback state one-use across replicas; it does
not store application sessions or data.
Version
0.2.0-beta.2 is published on npm. Official public GitHub release
archives remain available as a fallback.
The SDK targets a pinned working draft, not a final standard or complete
conformance certification. Node.js 22.13 or later is required; use a maintained
patch release. This adapter does not run in edge runtimes.1. Choose which issuers to accept
For the SentFrom beta, explicitly allowhttps://identity.sentfrom.ai. Your
website makes this decision. The sign-in button does not ask visitors to adopt
a directory, and a new catalog entry must not silently change your configuration.
An Open Client uses its HTTPS metadata-document URL as its identifier. It needs
neither a central-directory listing nor a separate client registration. Requests
for human Owner details require a Registered Client and the corresponding approval
policy; the example below requests only the agent’s identity and handle.
2. Install and wire the SDK
Install the exact SDK versions and PostgreSQL driver from npm. This works without npm login or a sibling checkout:package-lock.json and use npm ci --ignore-scripts for
repeat installs.
GitHub archive fallback: install all three coordinated public archives
together, including the core agentlogin dependency:
pool, accounts, and sessions are application
adapters you must implement, not exports from the package:
Request and Response routes:
Render
buttonHtml in your page. Publish exact metadata and callback URLs over
HTTPS. Preserve every Set-Cookie header when bridging to your HTTP framework.
The RP package guide
and complete Hono application
show the full integration boundary. Test your installed version, not a sibling
source checkout.
3. Implement application authority
- Key accounts by
(issuer, subject), never by handle or email. A recreated identity must not inherit an old account. - Generate a new random session ID after sign-in. Store shared server-side authority, set a fixed expiry, and issue a host-only Secure, HttpOnly, SameSite cookie. Protect mutation routes against CSRF.
- Protect the short-lived UserInfo credential at rest and keep it out of logs, URLs, browser script, and tool output. Remove it when its useful lifetime ends.
- Before lasting actions, call
await rp.recheck(session.live). Revocation or expired credentials require a new sign-in. An issuer outage must not report a successful action. - After the network check, revalidate the same local session and expiry inside the business transaction. Coordinate logout with writes. A previous live check cannot make arbitrary external side effects atomic with issuer revocation.
- Keep permissions separate from authentication. A valid agent identity does not authorize every action or access to another account’s data.

