Skip to content

Using Environment Variables inside of sdk.config.ts #38

Open
@jacobfogolyan

Description

@jacobfogolyan

What is your question / Please describe your issue

Since you would need to add env vars to the sdk.config.ts file, you cannot access environment variables directly. As you probably noticed, you need to add environment variables to your runtimeConfig.public. But since we are locked into this approach, you will need to make this a function to be exported and access const $config = useRuntimeConfig() inside this function.

However the issue with this is, then it can only be called within nuxt context. Which means you need to export a function, not the object. Then of course you need to change all references to this.

What version of Nuxt3-Magento2-Store are you using?

1.0.0

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions