Skip to content

Conversation

airhorns
Copy link
Contributor

@airhorns airhorns commented Oct 10, 2025

  • fetch the token using a hardcoded token tool we're expecting to exist server side
  • don't allow the api to run requests until the token has been returned

Note

Introduce @gadgetinc/react-chatgpt-apps providing a Provider that authenticates via OpenAI tool and injects a Bearer token into Gadget API requests.

  • New package packages/react-chatgpt-apps
    • Auth Provider: Provider component fetches Gadget auth via window.openai.callTool("__getGadgetAuthTokenV1"), sets custom auth mode, and injects Authorization: Bearer <token> into fetch and transaction params.
    • Token utility: getToken helper encapsulates token retrieval and error handling.
    • Type exports: Adds OpenAI Apps SDK-related types and globals in src/index.ts.
    • Build/Test config: Package package.json, TypeScript configs, and Jest setup with SWC.
    • Tests: Specs validating token fetch, request gating until auth resolves, single fetch for concurrent requests, and stable behavior across rerenders.
  • Repo config/docs
    • Add package to root Jest projects and link in root README.
    • Lockfile updated for new workspace.

Written by Cursor Bugbot for commit 4134649. This will update automatically on new commits. Configure here.

@airhorns airhorns force-pushed the chatgpt-widgets branch 3 times, most recently from d6c4371 to c00d6fa Compare October 10, 2025 19:28
 - fetch the token using a hardcoded token tool we're expecting to exist server side
 - don't allow the api to run requests until the token has been returned
@airhorns airhorns changed the title WIP ChatGPT apps provider Add ChatGPT apps package Oct 10, 2025
@airhorns airhorns marked this pull request as ready for review October 10, 2025 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant