feat: replace Infura IPFS credentials with a Pinata JWT and gateway token - #1182
Merged
Conversation
react-kit 0.42.1 -> 0.43.0-alpha.0 and common 1.32.2 -> 1.35.0-alpha.0, which bring in core-components#1040: Infura's IPFS service is decommissioned and the default metadata storage moves to Pinata. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…oken core-components#1040 splits the old Infura project id/secret pair into two distinct credentials, and the default ipfsMetadataUrl for every environment is now https://uploads.pinata.cloud/v3/files: - ipfsJwt authenticates uploads, as `Authorization: Bearer <jwt>`. This is what the project id/secret used to do, so REACT_APP_IPFS_JWT replaces REACT_APP_INFURA_IPFS_PROJECT_ID and REACT_APP_INFURA_IPFS_PROJECT_SECRET. - ipfsGatewayToken authenticates reads through a gateway that restricts them, as `x-pinata-gateway-token`. REACT_APP_IPFS_GATEWAY_TOKEN is optional: a gateway with public reads needs none, and the SDK ignores the value for any host that is not a dedicated Pinata gateway. It is therefore left out of the deploy workflow's required-value check. The Pinata upload endpoint cannot serve reads, so CoreSDKContext and useIpfsStorage now also pass ipfsGateway; without it every metadata read falls through to the SDK's public default gateway. Nothing here fails to compile without the change - ipfsProjectId and ipfsProjectSecret are deprecated rather than removed - but left as-is, uploads would reach Pinata carrying an Infura Basic header and 401. Header construction reuses the library's own hooks.getIpfsHeaders rather than rebuilding it, so the spelling stays in step with what IpfsMetadataStorage reads. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
levalleux-ludo
had a problem deploying
to
testing
September 8, 2026 13:12 — with
GitHub Actions
Failure
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The migration updates config, SDK wiring, and deploy-time env validation consistently, and only minor maintainability feedback remains.
Pull request overview
This PR migrates the dapp’s IPFS integration away from deprecated Infura credentials to Pinata’s JWT + optional gateway token model, aligning the app’s runtime configuration with the updated @bosonprotocol/react-kit/common stack.
Changes:
- Replace
ipfsProjectId/ipfsProjectSecretusage withipfsJwt+ipfsGatewayTokenand reusehooks.getIpfsHeadersfor upload header construction. - Pass
ipfsGatewayandipfsGatewayTokenthrough Core SDK context and IPFS metadata storage hook to support authenticated reads via dedicated Pinata gateways. - Update deploy workflow +
.env.exampleto use the new environment variables and bump@bosonprotocol/common/@bosonprotocol/react-kitversions.
File summaries
| File | Description |
|---|---|
src/pages/common/OfferFullDescription.tsx |
Updates widget provider props to use Pinata JWT/gateway token instead of Infura project credentials. |
src/lib/utils/hooks/useIpfsStorage.ts |
Extends IPFS metadata storage initialization to pass gateway + optional gateway token for reads. |
src/lib/config.ts |
Adds REACT_APP_IPFS_JWT / REACT_APP_IPFS_GATEWAY_TOKEN config wiring and swaps header construction to hooks.getIpfsHeaders. |
src/components/core-sdk/CoreSDKContext.tsx |
Plumbs ipfsGateway and ipfsGatewayToken into useCoreSdk initialization. |
package.json |
Bumps @bosonprotocol/common and @bosonprotocol/react-kit to versions that support the new IPFS auth model. |
pnpm-lock.yaml |
Lockfile updates reflecting dependency bumps and transitive additions. |
.github/workflows/deploy_reusable.yaml |
Switches deploy secrets/env validation from Infura credentials to REACT_APP_IPFS_JWT (+ optional gateway token). |
.env.example |
Documents the new env vars and updates example gateway host away from infura-ipfs.io. |
Review details
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
- Files reviewed: 7/8 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Preview deployment
Built from aac9d3d. |
providerProps already spreads ...CONFIG, and ipfsJwt / ipfsGatewayToken are top-level CONFIG keys with identical names, so the explicit assignments were exact duplicates of the spread values. The neighbouring explicit entries stay because they rename or reshape CONFIG fields; these two did not, and would silently drift from the spread if CONFIG is refactored later. Addresses PR #1182 review comment r3958283628. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
levalleux-ludo
had a problem deploying
to
testing
September 8, 2026 14:19 — with
GitHub Actions
Error
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adapts the dapp to core-components#1040, pulled in by the react-kit
0.43.0-alpha.0/ common1.35.0-alpha.0bump in the first commit.Why
Infura's IPFS service is decommissioned. The default
ipfsMetadataUrlfor every environment is nowhttps://uploads.pinata.cloud/v3/files, and the oldipfsProjectId/ipfsProjectSecretpair is replaced by two distinct credentials:ipfsJwtAuthorization: Bearer <jwt>ipfsGatewayTokenx-pinata-gateway-tokenThe old project id/secret only ever fed the upload header, so
REACT_APP_IPFS_JWTis its direct replacement.Nothing fails to compile without this change —
ipfsProjectId/ipfsProjectSecretare deprecated rather than removed, andpnpm tscwas green before it. This is a runtime migration: left as-is, every upload would reach Pinata carrying an Infura Basic header and 401.Env vars
REACT_APP_INFURA_IPFS_PROJECT_ID+REACT_APP_INFURA_IPFS_PROJECT_SECRET→REACT_APP_IPFS_JWT(required)REACT_APP_IPFS_GATEWAY_TOKEN(optional) — a gateway with public reads needs none, and the SDK ignores the value for any host that is not a dedicated Pinata gateway. Deliberately left out of the deploy workflow's required-value guard so those environments still deploy green..env.examplealso repointsREACT_APP_IPFS_GATEWAY/REACT_APP_IPFS_IMAGE_GATEWAY, which still namedbosonprotocol.infura-ipfs.io— a host that no longer resolves.Also passing
ipfsGatewayThe Pinata upload endpoint cannot serve reads, so
IpfsMetadataStoragecan no longercat().CoreSDKContextanduseIpfsStoragenow passipfsGatewayalongside the token; without it every metadata read falls through to the SDK's public default gateway.Header construction reuses the library's own
hooks.getIpfsHeadersinstead of rebuilding it, so the spelling stays in step with whatIpfsMetadataStoragereads back.Deploys break until testing / staging / production are updated:
REACT_APP_IPFS_JWT— the deploy now fails fast without itREACT_APP_IPFS_GATEWAY_TOKENonly where the gateway restricts readsREACT_APP_INFURA_IPFS_PROJECT_ID/REACT_APP_INFURA_IPFS_PROJECT_SECRETREACT_APP_IPFS_GATEWAY/REACT_APP_IPFS_IMAGE_GATEWAYvariables offinfura-ipfs.ioVerification
pnpm tsc,pnpm lint:check,pnpm prettier:check— all cleanpnpm test— 44 tests, 3 suites, all passingpnpm build— succeeds; confirmedREACT_APP_IPFS_JWTis inlined into the main bundleINFURA_IPFS/infuraProjectreferences left in the treeStill to do by hand, against a real Pinata JWT (DevTools → Network): a product page read returns 200; a seller-profile logo upload
POSTs touploads.pinata.cloud/v3/fileswithAuthorization: Bearer …and returns 200; the offer full-description widget renders. Worth running twice — once withREACT_APP_IPFS_GATEWAY_TOKENunset against a public gateway, once set against a restricted*.mypinata.cloudone.Out of scope
public/index.html'sog:imagestill points at a deadinfura-ipfs.ioCID.Video.tsxstrips that same host off legacy URLs and refetches viaipfs://<cid>— kept, since existing metadata still carries those URLs.lens.infura-ipfs.ioinlib/utils/ipfs.tsis Lens' gateway, not ours.🤖 Generated with Claude Code