Easily generate an assetlinks.json
for Android app association in your Next.js
project. This tool creates .well-known/assetlinks.json
, allowing Android apps
to handle URLs.
Install via npm:
npm i next-assetlinks
# or
yarn add next-assetlinks
-
Create a Config File
Addnext-assetlinks.config.js
to your project root:// next-assetlinks.config.js module.exports = { packageName: "com.example.app", sha256Fingerprint: ["FINGERPRINT_1", "FINGERPRINT_2"], };
packageName
: Your Android app's package name.sha256Fingerprint
: Array of SHA-256 fingerprints for your app's signing certificates.
-
Add Script to
package.json
Update package.json to add the generate-assetlinks script:"scripts": { "generate-assetlinks": "node ./node_modules/next-assetlinks/cli.js" }
Run the command to generate assetlinks.json
:
npm run generate-assetlinks
# or
yarn generate-assetlinks
This will create or update public/.well-known/assetlinks.json
with the
configured package name and fingerprints.
Contributions are welcome!
Package by Reach Digital
Licensed under MIT. See LICENSE for details.