Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change manifest on runtime #177

Open
pbsl opened this issue Dec 14, 2024 · 1 comment
Open

Change manifest on runtime #177

pbsl opened this issue Dec 14, 2024 · 1 comment

Comments

@pbsl
Copy link

pbsl commented Dec 14, 2024

Hi, I am developing a Nuxt3 application with the ‘vite-pwa/nuxt’ module and I was wondering if it was possible to dynamically change the manifest of the application.

I mean, to explain the use case well, our Nuxt application is going to be called from different urls (for example: example1.com, example2.com, etc) where all of these applications are going to be configurable in database, where we will look at the ‘servername’ that is being visited to show different information.

The question is whether it is possible for this Nuxt application to be able to serve different manifests so that they are different PWAs depending on the servername the user is visiting.

So if I enter the domain example1.com it will ask me if I want to install the ‘app’. On the other hand, regardless if I have the example1.com app, and I visit example2.com it should ask me the same thing.

Therefore, as we are linked to a database for the configuration of the application I need everything to be done in runtime.

Is it possible to make this functionality, so that the icons, name, description, etc... change according to the domain we visit with only a Nuxt3 application?

Apologies in advance for my level of English and for being inexperienced in PWA technology. 🥴

@userquin
Copy link
Member

Maybe you can use the strategy at elk.zone where we add 2 web manifest per locale, you only need to disable the manifest with false and add a custom module checking for the domain at build time:

From custom module you only need the logic to deal with the web manifest for dev and build, the rest if the logic isn't required (the rest of the logic is included in the pwa nuxt module)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants