Registry / auth-security / poe-oauth

poe-oauth

JSON →
library0.0.6jsnpmunverified

OAuth client and auth verification for the Poe API (v0.0.6). Provides PKCE-based OAuth flow with local callback server and API key validation. Ships TypeScript types. Release cadence: active development within the poe-code monorepo (v3.x branch). Differentiators: minimal dependencies, built-in landing page customization, and keyless identity verification via checkAuth. No alternative standalone packages exist for Poe OAuth.

npm install poe-oauth
INSTALL
IMPORT
SIG · POE-OAUTH
P
poe-oauth
auth-securityjavascriptv0.0.6
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

createOAuthClient
import { createOAuthClient } from 'poe-oauth'
const createOAuthClient = require('poe-oauth')
ESM-only; package has no CJS export.
checkAuth
import { checkAuth } from 'poe-oauth'
import checkAuth from 'poe-oauth'
Named export, not default.
type OAuthResult
import type { OAuthResult } from 'poe-oauth'
const { OAuthResult } = require('poe-oauth')
TypeScript type; not a runtime value.

Demonstrates full OAuth flow: creating client, authorizing, waiting for callback, and verifying the API key.

import { createOAuthClient, checkAuth } from 'poe-oauth'; // Start OAuth flow const client = createOAuthClient({ clientId: process.env.POE_CLIENT_ID ?? '', openBrowser: async (url) => { console.log('Open:', url); }, readLine: async () => { return prompt('Paste token:') ?? ''; } }); const authorization = await client.authorize(); console.log('Authorization URL:', authorization.authorizationUrl); const result = await authorization.waitForResult(); console.log('API Key:', result.apiKey); // Verify token const identity = await checkAuth({ apiKey: result.apiKey }); console.log('Identity:', identity);
Debug
Known issues
gotchaThe OAuth client requires both openBrowser and readLine callbacks; providing only one will cause authorize() to hang.
fix
Always provide both callbacks, even if one is a no-op for your use case.
affects: >=0.0.1
gotchaDefault endpoints point to poe.com and api.poe.com; using custom endpoints requires both authorizationEndpoint and tokenEndpoint to be set together.
fix
If overriding one endpoint, override both to avoid mismatched flow.
affects: >=0.0.1
deprecatedThe authorize() method returns an object with waitForResult(); using an older pattern that expects a direct promise is now deprecated.
fix
Use await client.authorize().waitForResult() instead of awaiting client.authorize() directly.
affects: <0.0.5
Errors
Common errors & fixes
TypeError: client.authorize is not a function
Importing default instead of named export.
fix
import { createOAuthClient } from 'poe-oauth'
Error: Cannot find module 'poe-oauth'
Package not installed or not in CJS context.
fix
npm install poe-oauth and use ESM (import syntax).
TypeError: a.readLine is not a function
readLine callback not provided or not async.
fix
Provide an async function that returns a string for readLine.
Error: PKCE verification failed
Mismatched code_verifier caused by network interception or manual token paste.
fix
Ensure the token URL is called with the correct code_verifier; avoid modifying the authorization code.
Upgrade
Version history
0.0.6latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
11 hits · last 30 days
node
10
OpenAI (training)
1
Resources
poe-oauth — npm install poe-oauth · libregistry