All Projects → voorhoede → nuxt-twa-module

voorhoede / nuxt-twa-module

Licence: MIT license
📱Nuxt module to transform your PWA into an Android app, using Trusted Web Activities (TWA)

Programming Languages

javascript
184084 projects - #8 most used programming language
shell
77523 projects
Vue
7211 projects

Projects that are alternatives of or similar to nuxt-twa-module

likecoin-button
Every Like is a reward. Turn your Likes into actual income now.
Stars: ✭ 18 (-60%)
Mutual labels:  nuxt
nuxtwebsite
A simple Nuxt.js setup to create websites with blog feature using Storyblok as CMS and Netlify to deploy it.
Stars: ✭ 29 (-35.56%)
Mutual labels:  nuxt
vite.org
The Official Website of Vite - https://vite.org
Stars: ✭ 31 (-31.11%)
Mutual labels:  nuxt
loading-screen
Loading Screen Module for Nuxt.js
Stars: ✭ 89 (+97.78%)
Mutual labels:  nuxt
nuxt-fundamentals
Source code for the Nuxt.js Fundamentals course
Stars: ✭ 40 (-11.11%)
Mutual labels:  nuxt
open-fixture-library
A library and website for lighting technology's DMX fixture definition files.
Stars: ✭ 113 (+151.11%)
Mutual labels:  nuxt
nuxtjs-examples
Example apps of Nuxt.js framework
Stars: ✭ 51 (+13.33%)
Mutual labels:  nuxt
homepage-nuxtjs
Here we're trying to ship the front of homepage of KNIT
Stars: ✭ 13 (-71.11%)
Mutual labels:  nuxt
nuxt-ghost
Easy Ghost content API integration with Nuxt.js.
Stars: ✭ 27 (-40%)
Mutual labels:  nuxt
nuxtjs-sample
Nuxtjs sample! Typescript + Vuetify + Jest! (rails api server: https://github.com/walkersumida/rails-api-for-front)
Stars: ✭ 28 (-37.78%)
Mutual labels:  nuxt
nuxt-speedkit
nuxt-speedkit will help you to improve the lighthouse performance score (100/100) of your website.
Stars: ✭ 401 (+791.11%)
Mutual labels:  nuxt
nuxt-vite
Nuxt + Vite!! HMR so fast it'll make your head spin! Plus all the benefits of Nuxt
Stars: ✭ 54 (+20%)
Mutual labels:  nuxt
nuxt-supabase
A supa simple wrapper around Supabase.js to enable usage within Nuxt.
Stars: ✭ 146 (+224.44%)
Mutual labels:  nuxt
html2md
helloworld 开发者社区开源的一个轻量级,强大的 html 一键转 md 工具,支持多平台文章一键转换,并保存下载到本地。
Stars: ✭ 332 (+637.78%)
Mutual labels:  nuxt
nuxt-modules
AX2's Nuxt modules
Stars: ✭ 30 (-33.33%)
Mutual labels:  nuxt
applicationinsights-module
Application Insights module for NuxtJS
Stars: ✭ 14 (-68.89%)
Mutual labels:  nuxt
portfolio-2018
My personal portfolio / resume online
Stars: ✭ 18 (-60%)
Mutual labels:  nuxt
nuxt-seomatic-meta
A module for connecting Nuxt.js to the Craft CMS SEOmatic plugin via GraphQL. Nuxt-o-matic!
Stars: ✭ 28 (-37.78%)
Mutual labels:  nuxt
nuxt-delay-hydration
Improve your Nuxt.js v2 Google Lighthouse score by delaying hydration ⚡️
Stars: ✭ 135 (+200%)
Mutual labels:  nuxt
nuxt-modules-cli
Browse Nuxt.js modules from the terminal
Stars: ✭ 25 (-44.44%)
Mutual labels:  nuxt

Nuxt TWA module

npm style guide Nuxt TWA module Nuxt TWA module Depfu Status

Nuxt module to transform your PWA into an Android app, using Trusted Web Activities (TWA)

Trusted Web Activities (TWA) allow you to package a Progressive Web App (PWA) in an Android App. You can upload this app to the Google Play Store. This module sets the necessery configuration for running the app, creates icons and generates files used by the application.

Requirements

Trusted Web Activities only work when you are using a legitimate service worker, so we highly recommend using the PWA module or setting up a PWA yourself.

To upload an app to the Google Play Store you need a key for signing. To create one follow these instructions

Important notice

Store the key in a safe place, if you uploaded your app with a key you will need the same key for each update.

After you've created this key you will need to copy the SHA-256 for the nuxt configuration file by running this command:

keytool -list -v -keystore LOCATION_OF_YOUR_KEY.keystore

You will need Android Studio to create the signed app.

Installation 🚀

npm install nuxt-twa-module --save-dev

Setting up configuration

Add nuxt-twa-module to modules section of nuxt.config.js.

  {
    modules: [
      ['nuxt-twa-module', {
        /* module options */
        defaultUrl: 'https://your-url.com',
        hostName: 'your-url.com',
        sha256Fingerprints: ['/* your SHA-256 keys */'],
        applicationId: 'com.example.example',
        launcherName: 'Your app name',
        versionCode: 1,
        versionName: '1.0',
        statusBarColor: /* color */,

        /* optional */
        /* overwrite default location for icon */
        iconPath: '/static/icon.png'
        /* Overwrite folder where to put .wellknown */
        distFolder: '.nuxt/dist/client',
      }],
    ]
  }

the sha256Fingerprints by is an array with one SHA-256 key string. But if you have multiple you can add them to the array. More information about the website asociation: https://developer.android.com/training/app-links/verify-site-associations#web-assoc

Time to build 🏗

When the configuration is done you can run your project like you are used to.

npm run build

or

npm run generate

Output

  • An android folder in your project root, which you can open in Android Studio to build your app. When you've build and tested your app you can use Generate Signed Bundle/APK. This will generate a .aab file that can be uploaded to the Google Play Store.
  • Your Nuxt app with an added .well-known folder which is needed to make your domain trusted with the app in the store.

Debug

To be able to test the Android application, you need to tell Chrome on your device it can trust your PWA. For this you need to have android-platform-tools installed on your machine.

brew cask install android-platform-tools

In Chrome on your device, go to chrome://flags and enable Enable command line on non-rooted devices

On your machine, run the following command to whitelist your URL in Chrome:

adb shell "echo '_ --disable-digital-asset-link-verification-for-url=\"<your URL>\"' > /data/local/tmp/chrome-command-line"

Links


Licence

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].