{"id":18569020,"url":"https://github.com/filipchalupa/nextjs-webmanifest","last_synced_at":"2025-07-06T02:35:32.566Z","repository":{"id":164388997,"uuid":"639822813","full_name":"FilipChalupa/nextjs-webmanifest","owner":"FilipChalupa","description":"Simplify adding webmanifest to your web.","archived":false,"fork":false,"pushed_at":"2024-02-19T11:02:53.000Z","size":1191,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-27T02:11:30.672Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/nextjs-webmanifest","language":"TypeScript","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/FilipChalupa.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-05-12T09:58:30.000Z","updated_at":"2023-12-29T12:12:09.000Z","dependencies_parsed_at":"2024-02-19T12:28:22.317Z","dependency_job_id":"9924580a-152b-4ef5-8b8f-93f4f17c35cd","html_url":"https://github.com/FilipChalupa/nextjs-webmanifest","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FilipChalupa%2Fnextjs-webmanifest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FilipChalupa%2Fnextjs-webmanifest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FilipChalupa%2Fnextjs-webmanifest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FilipChalupa%2Fnextjs-webmanifest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FilipChalupa","download_url":"https://codeload.github.com/FilipChalupa/nextjs-webmanifest/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239301936,"owners_count":19616451,"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-11-06T22:31:40.922Z","updated_at":"2025-02-17T13:44:50.192Z","avatar_url":"https://github.com/FilipChalupa.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Next.js Webmanifest helper [![npm](https://img.shields.io/npm/v/nextjs-webmanifest.svg)](https://www.npmjs.com/package/nextjs-webmanifest) ![npm type definitions](https://img.shields.io/npm/types/nextjs-webmanifest.svg)\n\nSimplify adding webmanifest to your web.\n\n## Installation\n\n```bash\nnpm install nextjs-webmanifest\n```\n\n## Usage\n\n### With `pages` directory\n\nCreate `app.webmanifest.js` file inside your Next.js `pages/api` directory and use `createWebmanifestHandler`.\n\n#### `pages/api/app.webmanifest.js`\n\n```js\nimport { createWebmanifestHandler } from 'nextjs-webmanifest'\n\nexport default createWebmanifestHandler({\n\tname: 'My Super Trouper App',\n\tshort_name: 'App',\n\tstart_url: '/',\n\tdisplay: 'standalone',\n\ttheme_color: '#04a600',\n\tbackground_color: '#000000',\n\t// You can add more: https://developer.mozilla.org/en-US/docs/Web/Manifest\n})\n```\n\n#### Asynchronous\n\n```js\nexport default createWebmanifestHandler(async (request) =\u003e {\n\tconst locale = request.url.substring(1, 3)\n\tconst response = await fetch(`https://example.com/${locale}/manifest.json`)\n\tconst manifest = await response.json()\n\treturn manifest\n})\n```\n\n#### `\u003chead\u003e`\n\nDon't forget to add `\u003clink\u003e` to `\u003chead\u003e` to tell browser where to look for your webmanifest.\n\n```html\n\u003clink rel=\"manifest\" href=\"/api/app.webmanifest\" /\u003e\n```\n\n### With `app` directory\n\nCreate `route.js` file inside your Next.js `app/app.webmanifest` directory and use `createWebmanifestGET`.\n\n#### `app/app.webmanifest/route.js`\n\n```js\nimport { createWebmanifestGET } from 'nextjs-webmanifest'\n\nexport const GET = createWebmanifestGET({\n\tname: 'My Super Trouper App',\n\t// and more\n})\n```\n\n`createWebmanifestGET` can accept asynchronous function as well.\n\n#### `\u003chead\u003e`\n\nDon't forget to add `\u003clink\u003e` to `\u003chead\u003e` to tell browser where to look for your webmanifest.\n\n```html\n\u003clink rel=\"manifest\" href=\"/app.webmanifest\" /\u003e\n```\n\nor\n\n```js\nexport const metadata: Metadata = {\n\tmanifest: '/app.webmanifest',\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffilipchalupa%2Fnextjs-webmanifest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffilipchalupa%2Fnextjs-webmanifest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffilipchalupa%2Fnextjs-webmanifest/lists"}