Skip to content

Runtime config via app.config.ts #791

Closed

Description

@aklinker1

Feature Request

I'm working on an analytics module, and I need a way to pass config to the app at runtime, not build-time. Currently, modules only accept build config.

Nuxt does this via a <srcDir>/app.config.ts file and I want to do the same, I think it's a good pattern. However, I'm not going to support everything nuxt does. For now, I want to add:

  • Detect the file, or default to {}
  • Allow for module augmentation to add to the config type
  • From wxt/client, provide useAppConfig helper function to access the config defined in app.config.ts.

It will not support the following from nuxt:

  • Automatic type augmentation
  • Include variables from the .env file

Is your feature request related to a bug?

#790

What are the alternatives?

A clear and concise description of any alternative solutions or features you've considered.

Additional context

https://nuxt.com/docs/guide/directory-structure/app-config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions