@yan06/openai-oauth-core
v2.0.2
Published
Core auth and in-memory OpenAI-compatible transport for openai-oauth.
Maintainers
Readme
@yan06/openai-oauth-core
Lowest-level OpenAI OAuth and OpenAI-compatible transport primitives.
npm i @yan06/openai-oauth-coreMost apps should use openai-oauth, @yan06/openai-oauth-local, @yan06/openai-oauth-react, @yan06/openai-oauth-ai-sdk, or @yan06/openai-oauth-openai-client instead.
Package Notes
@yan06/openai-oauth-core is for advanced integrations and adapter authors.
Create an OpenAI-compatible transport from an explicit auth source:
import { createOpenAIOAuthTransport } from "@yan06/openai-oauth-core";
const transport = createOpenAIOAuthTransport({
auth: async () => session,
});
const baseURL = transport.baseURL;
const fetch = transport.fetch;The transport supports Responses, model discovery, image generation, and multipart image editing. Client adapters build higher-level interfaces such as Chat Completions on top.
Create an OAuth request:
import { createOpenAIOAuthRequest } from "@yan06/openai-oauth-core";
const request = await createOpenAIOAuthRequest({
redirectUri: "https://app.example.com/auth/callback",
});Core exports include:
createOpenAIOAuthTransportcreateOpenAIOAuthRequestexchangeOpenAIOAuthCoderefreshOpenAIOAuthTokensOpenAIOAuthOpenAIOAuthSessionSessionStore
