Vibeleaderboard
Index / tool
Visit npmx.dev
Category
Developer Tools
Rank
No. 1683Tools index
Pricing
Open Source
Type
TOOL
Builder
moeru-ai
GitHub
2 stars
Latest release
v0.0.3
Date

About

OpenAI Codex provider for xsAI — drop-in adapter to call Codex from the xsAI SDK.

What it does

A compact TypeScript library that manages Codex device sign-in and prepares authentication settings for an xsAI responses client. It refreshes expiring access tokens, carries account and optional session metadata into request headers, and lets applications receive updated credentials for persistence.

Why it's ranked here

The case is favorable for a narrow integration. Authentication, refresh timing, account discovery, cancellation, and request configuration live behind a small public surface. The constraints are equally clear: it depends on a beta responses package, requires a recent JavaScript runtime feature, and the supplied repository tree contains no tests.

What's good

Device authorization supports cancellation and reports useful server errors. Token refresh happens before expiry, preserves an existing account identifier when necessary, and exposes an update callback so applications can save new credentials. The model type suggests known options while still accepting custom model strings.

Tradeoffs

The responses workflow must disable storage, and Codex does not support the client’s maximum-output-token option. Runtime support must include the Baseline 2025 base64 decoding API. The peer dependency targets one beta release. Credential persistence remains application work, and no test files appear in the supplied tree.

How to use it well

Choose it for a TypeScript application already built around xsAI responses and needing interactive Codex device authentication. Persist refreshed credentials through the provided update hook and handle cancellation during login. It is not a general OpenAI client, a credential store, or a standalone production CLI.

Technical notes+

src/utils/auth.ts implements device authorization polling, JWT claim decoding with Uint8Array.fromBase64, account ID extraction, token exchange, refresh, abort handling, and bounded response-error details. src/utils/provider.ts refreshes tokens within CODEX_TOKEN_REFRESH_MARGIN_MS, then returns the apiKey, baseURL, headers, and model fields expected by @xsai-ext/responses. src/utils/const.ts fixes the authentication and ChatGPT Codex backend endpoints. src/types/models.ts declares known model literals while CreateCodexResult also permits arbitrary strings. scripts/example.ts demonstrates local environment persistence and streamed text consumption. package.json publishes ESM JavaScript and declarations from dist.

Observed

License
MIT
Primary language
TypeScript
Packaging
ES module npm package with JavaScript and TypeScript declaration outputs
Interface
Library API for xsAI responses; an interactive example script is included
Peer dependency
Requires @xsai-ext/responses at 0.5.0-beta.3
Runtime requirement
Requires Baseline 2025 Uint8Array base64 decoding support
Test structure
No test directory or test files appear in the supplied repository tree

Read from README.md, package.json, src/index.ts, src/utils/auth.ts, src/utils/const.ts, src/types/models.ts, src/utils/provider.ts, eslint.config.js, scripts/example.ts, LICENSE.md, tsconfig.json, tsconfig.lib.json, cspell.config.yaml, tsconfig.node.json, .github/FUNDING.yml.

What it can do

  • Generate code from natural language prompts

    Natural language description of desired code functionalityProgramming code in various languages

  • Complete partial code snippets

    Incomplete code with contextCompleted functional code

  • Convert code between programming languages

    Code written in one programming languageEquivalent code in another programming language

  • Debug and fix code errors

    Code with bugs or errorsCorrected, functional code

  • Explain code functionality

    Existing code snippetsNatural language explanations of what the code does

  • Generate unit tests

    Function or method definitionsComprehensive unit test code

Tags

codexxsaiopenaisdktypescript

Tech Stack

Node.jsTypeScript

Comments (0)

No comments yet

Editorially curated, with community endorsements as a secondary signal. Corrections welcome.