{"id":22164861,"url":"https://github.com/net2devcrypto/pinata-ipfs-nextjs-functions","last_synced_at":"2026-03-19T22:02:12.875Z","repository":{"id":129706013,"uuid":"592615051","full_name":"net2devcrypto/Pinata-IPFS-NextJS-Functions","owner":"net2devcrypto","description":"Simple Pinata IPFS Functions for Next JS to Upload Files and JSON.","archived":false,"fork":false,"pushed_at":"2023-01-24T06:02:06.000Z","size":5,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-29T21:43:32.300Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/net2devcrypto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-24T05:53:07.000Z","updated_at":"2023-02-02T09:51:40.000Z","dependencies_parsed_at":"2023-03-17T16:45:57.045Z","dependency_job_id":null,"html_url":"https://github.com/net2devcrypto/Pinata-IPFS-NextJS-Functions","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/net2devcrypto%2FPinata-IPFS-NextJS-Functions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/net2devcrypto%2FPinata-IPFS-NextJS-Functions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/net2devcrypto%2FPinata-IPFS-NextJS-Functions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/net2devcrypto%2FPinata-IPFS-NextJS-Functions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/net2devcrypto","download_url":"https://codeload.github.com/net2devcrypto/Pinata-IPFS-NextJS-Functions/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245304872,"owners_count":20593626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-02T05:11:17.148Z","updated_at":"2026-01-27T18:05:05.487Z","avatar_url":"https://github.com/net2devcrypto.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pinata-IPFS-NextJS-Functions\nSimple Pinata IPFS Functions for Next JS to Upload Files.\n\n\n\u003ch2\u003e Use in your NextJS App: \u003c/h2\u003e\n\n\nDependencies:\n\n```shell\nnpm i axios\n```\n\nUPLOAD FILES TO IPFS Using PINATA:\n\n// Replace key and secret with your Pinata api key and api secret.\n\nFUNCTION: \n\n\n```shell\n\n  async function sendFileToIPFS (e) {\n  \n        const file = e.target.files[0];\n        const formData = new FormData();\n        formData.append(\"file\", file);\n        \n        const key = 'Your Pinata Api Key';\n        const secret = 'Your Pinata Api Secret Key'\n        const url = \"https://api.pinata.cloud/pinning/pinFileToIPFS\"\n        \n       \n        const opts = JSON.stringify({\n          cidVersion: 0,\n        })\n        formData.append('pinataOptions', opts);\n        \n        const options = {\n          maxBodyLength: \"Infinity\",\n          headers: {\n          'Content-Type': `multipart/form-data; boundary=${formData._boundary}`,\n            pinata_api_key: key,\n            pinata_secret_api_key: secret,\n            Accept: 'text/plain',\n        }\n      }\n        const resFile = await axios.post(url, formData, options);\n        const ImgHash = `ipfs://${resFile.data.IpfsHash}`;\n        console.log(ImgHash);\n      }\n```\n\n Attach to your html upload button :\n \n ```shell\n \n  \u003cinput\n    className=\"btn btn-secondary\"\n    type=\"file\"\n    name=\"Asset\"\n    onChange={sendFileToIPFS}/\u003e\n    \n ```\n \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnet2devcrypto%2Fpinata-ipfs-nextjs-functions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnet2devcrypto%2Fpinata-ipfs-nextjs-functions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnet2devcrypto%2Fpinata-ipfs-nextjs-functions/lists"}