separate-env-module | Tear your variables | Frontend Framework library

 by   nuxt-community JavaScript Version: Current License: MIT

kandi X-RAY | separate-env-module Summary

kandi X-RAY | separate-env-module Summary

separate-env-module is a JavaScript library typically used in User Interface, Frontend Framework, Vue, Next.js applications. separate-env-module has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can install using 'npm i @nuxtjs/separate-env' or download it from GitHub, npm.

Separated environment variables for server and client build. :warning: With Nuxt v2.13 you might want to use the new runtime config instead of this.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              separate-env-module has a low active ecosystem.
              It has 54 star(s) with 4 fork(s). There are 4 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 1 open issues and 5 have been closed. On average issues are closed in 36 days. There are 10 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of separate-env-module is current.

            kandi-Quality Quality

              separate-env-module has 0 bugs and 0 code smells.

            kandi-Security Security

              separate-env-module has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              separate-env-module code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              separate-env-module is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              separate-env-module releases are not available. You will need to build from source code and install.
              Deployable package is available in npm.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of separate-env-module
            Get all kandi verified functions for this library.

            separate-env-module Key Features

            No Key Features are available at this moment for separate-env-module.

            separate-env-module Examples and Code Snippets

            No Code Snippets are available at this moment for separate-env-module.

            Community Discussions

            Trending Discussions on separate-env-module

            QUESTION

            Securing API keys in Nuxtjs
            Asked 2019-Oct-18 at 15:54

            I've researched and found three different possibilities to solving my case: I'd like to make an async API call (using dotenv variables to store the credentials) and commit the returned data to Vuex on app init --keeping the creds secure.

            1. Currently I'm attempting using serverMiddleware, but I'm having trouble accessing the context. Is this possible? Currently just getting a "store is not defined" error.

            2. Also, after researching, I keep seeing that it's not a good idea to use regular middleware, as running any code on the client-side exposes the env variable... But I'm confused. Doesn't if (!process.client) { ... } take care of this? Or am I missing the bigger picture.

            3. Additionally, if it does turn out to be okay to use middleware to secure the credentials, would using the separate-env-module be wise to make doubly sure that nothing gets leaked client-side?

            Thanks, I'm looking forward to understanding this more thoroughly.

            ...

            ANSWER

            Answered 2019-Oct-18 at 15:54

            You can use serverMiddleware.

            You can do it like this:

            client -> call serverMiddleware -> servermiddleware calls API.

            that way API key is not in client but remains on the server.

            Example:

            remote api is: https://maps.google.com/api/something

            your api: https://awesome.herokuapp.com

            since your own api has access to environment variables and you don't want the api key to be included in the generated client-side build, you create a serverMiddleware that will proxy the request for you.

            So that in the end, your client will just make a call to https://awesome.herokuapp.com/api/maps, but that endpoint will just call https://maps.google.com/api/something?apikey=123456 and return the response back to you

            Source https://stackoverflow.com/questions/58404032

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install separate-env-module

            Add @nuxtjs/separate-env dependency to your project
            Add @nuxtjs/separate-env to the modules section of nuxt.config.js

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/nuxt-community/separate-env-module.git

          • CLI

            gh repo clone nuxt-community/separate-env-module

          • sshUrl

            git@github.com:nuxt-community/separate-env-module.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link