{"id":18655,"library":"passji","title":"passji","description":"Passji is an OIDC-based authentication service that uses emoji identities and WebAuthn passkeys instead of passwords. Version 0.0.2 is currently available. It provides SDKs for React, Next.js (Auth.js), Better Auth, Express, Hono, and Passport.js. Key differentiators: pseudonymous by default (no email required), AI-native API keys for agents, and emoji-based user identity. It ships TypeScript types and is designed for modern web and AI agent authentication flows.","status":"active","version":"0.0.2","language":"javascript","source_language":"en","source_url":"https://github.com/passji/passji-mono","tags":["javascript","passji","auth","oauth","oidc","emoji","passkey","webauthn","react","typescript"],"install":[{"cmd":"npm install passji","lang":"bash","label":"npm"},{"cmd":"yarn add passji","lang":"bash","label":"yarn"},{"cmd":"pnpm add passji","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"For Express server integration (server SDK)","package":"express","optional":true},{"reason":"Required for Express session support","package":"express-session","optional":true},{"reason":"For Hono framework integration","package":"hono","optional":true},{"reason":"For Next.js integration (nextauth export)","package":"next","optional":true},{"reason":"For React client-side hooks and components","package":"react","optional":true},{"reason":"Used for secret definition/schema","package":"secretdef","optional":true}],"imports":[{"note":"Browser/client-side SDK is in the /client subpath.","wrong":"import { createClient } from 'passji'","symbol":"createClient","correct":"import { createClient } from 'passji/client'"},{"note":"Server-side SDK is in the /server subpath. Use this for code exchange and token verification.","wrong":"import { createServer } from 'passji'","symbol":"createServer","correct":"import { createServer } from 'passji/server'"},{"note":"React components are exported from 'passji/react'.","wrong":"import { PassjiProvider } from 'passji'","symbol":"PassjiProvider","correct":"import { PassjiProvider, usePassji } from 'passji/react'"},{"note":"NextAuth provider is a default export from 'passji/nextauth'.","wrong":"import { Passji } from 'passji/nextauth'","symbol":"Passji (NextAuth)","correct":"import Passji from 'passji/nextauth'"},{"note":"Better Auth helper is a named export 'passji' from 'passji/better-auth'.","wrong":"import passji from 'passji/better-auth'","symbol":"passji (Better Auth)","correct":"import { passji } from 'passji/better-auth'"}],"quickstart":{"code":"import { createClient } from 'passji/client';\nimport { createServer } from 'passji/server';\nimport { PassjiProvider, usePassji } from 'passji/react';\n\n// Client-side: generate authorization URL with PKCE\nconst client = createClient({\n  clientId: process.env.PASSJI_CLIENT_ID ?? '',\n  redirectUri: 'http://localhost:3000/callback'\n});\nconst { url, codeVerifier } = await client.createAuthorizationURL();\n\n// Server-side: exchange code for tokens\nconst server = createServer({\n  clientId: process.env.PASSJI_CLIENT_ID ?? '',\n  clientSecret: process.env.PASSJI_CLIENT_SECRET ?? '',\n  redirectUri: 'http://localhost:3000/callback'\n});\nconst tokens = await server.exchangeCode('code', codeVerifier);\nconst user = await server.verifyIdToken(tokens.idToken);\nconsole.log(user.emojiId);\n\n// React: use PassjiProvider and usePassji\nfunction App() {\n  return (\n    <PassjiProvider clientId={process.env.PASSJI_CLIENT_ID ?? ''} onToken={(token) => fetch('/api/auth', { method: 'POST', body: JSON.stringify({ token }) })}>\n      <LoginButton />\n    </PassjiProvider>\n  );\n}\nfunction LoginButton() {\n  const { signIn, user } = usePassji();\n  if (user) return <span>{user.emojiId}</span>;\n  return <button onClick={signIn}>Sign in</button>;\n}","lang":"typescript","description":"Demonstrates client-side authorization URL generation with PKCE, server-side code exchange and ID token verification, and React hooks integration."},"warnings":[{"fix":"Use the correct subpath import for your framework (e.g., 'passji/react' for React).","message":"Import paths differ by framework: /client, /server, /react, /nextauth, /better-auth, /passport. Importing from 'passji' only gives core types.","severity":"breaking","affected_versions":">=0.0.1"},{"fix":"Ensure server-side code uses 'passji/server' and client-side uses 'passji/client'.","message":"The client-side createClient() must be used only in browser environments; it generates PKCE code verifiers. Do not import from 'passji/server' on the client.","severity":"gotcha","affected_versions":">=0.0.1"},{"message":"No deprecations known yet for version 0.0.2.","severity":"deprecated","affected_versions":"none"},{"fix":"Implement your own /api/auth endpoint that uses createServer to verify the token.","message":"The React provider requires an onToken callback to send the token to your own API; it does not automatically handle server-side validation.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Install express-session: npm install express-session","message":"Express integration requires express-session to be installed; the package declares it as a peer dependency.","severity":"gotcha","affected_versions":">=0.0.1"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Install passji: npm install passji@latest","cause":"Import from 'passji/client' but the package is not installed or version is old.","error":"Cannot find module 'passji/client'"},{"fix":"Use: import Passji from 'passji/nextauth' (default import)","cause":"Importing Passji as default but using named import.","error":"Passji is not defined (NextAuth)"},{"fix":"Wrap your component tree with <PassjiProvider> before using usePassji.","cause":"usePassji hook used outside of PassjiProvider.","error":"Uncaught TypeError: Cannot destructure property 'signIn' of '(0 , ...).usePassji(...)' as it is undefined."},{"fix":"Change import to: import { createClient } from 'passji/client'","cause":"Imported createClient from 'passji' instead of 'passji/client'.","error":"TypeError: client.createAuthorizationURL is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}