Skip to content

Latest commit

 

History

History
108 lines (58 loc) · 6.66 KB

Configuration.adoc

File metadata and controls

108 lines (58 loc) · 6.66 KB

Configuration

.env-File

The .env file allows you to provide required variables for the local build process. We recommend that you do not check them into your source code management. Ideally, you inject them later via your CI/CD process. The environment variables follow a strict naming convention enforced by Nuxt. More information can be found in nuxt.config.ts

NUXT_PUBLIC_MODE "preview" | "release"

We distinguish between preview (editorial) and released data. This is the traditional FirstSpirit way. Specify here which data should be loaded by the PWA. Use "preview" for a PWA instance for editorial purposes, and "release" for a PWA showing released content, e.g. for your production PWA.

NUXT_PRIVATE_PROJECT_ID string

Several projects can be configured on your FirstSpirit server. In order for the PWA to know which data it needs to access, it needs the UUID of the relevant project. You can copy the UUID from FirstSpirit project settings, menu "Project", field "Global UUID".

NUXT_PRIVATE_TENANT_ID string

The tenantId is used by the PWA to distinguish between the different environments provided to you. This is the subdomain part of your cloud URL. Usually cloud customers have three environments, one for development, one for quality assurance, and one production environment. Each environment has a different subdomain.

NUXT_PRIVATE_CAAS string

The URL under which the CaaS can be reached. This URL is only used on the server and is not visible to the user in the client. Fill in only the host name of your CaaS instance. You will find the URL in the FirstSpirit project settings, menu "Project components", configuration Dialog of "CaaS Connect Project App", field "Preview Collection API" or "Release Collection API", depending on the mode (see NUXT_PUBLIC_MODE above). Only the domain part is needed here.

NUXT_PRIVATE_API_KEY string

This API key is required by the PWA to obtain authorized access to the CaaS and navigation service. You will find a list of API keys in the FirstSpirit project settings, in the same dialog as mentioned above. Use one of the keys labeled "Preview (read only)" or "Release (read only)", depending on the mode (see NUXT_PUBLIC_MODE above).

NUXT_PRIVATE_NAVIGATION_SERVICE string

The URL under which the navigation service is available. This URL is only used on the server and is not visible to the user in the client. Copy the URL in the FirstSpirit project settings, menu "Project components", the configuration dialog of the "Navigation Project Configuration". Use either the "release" or "preview" URL, depending on the mode (see NUXT_PUBLIC_MODE above). Only the host part including the following endpoint "/navigation" is needed here.

CI

We use husky to enforce branch protection rules to prevent direct commits and pushes to the main branch. On your local machine this variable is not needed, but in your CI it can be set to 1 to allow the semantic release plugin to do releases. This is done automatically by Github.

(Only needed when NUXT_PUBLIC_MODE is set to "preview" and the PWA should be used inside the editorial environment.)

Snap Library is an external dependency which offers a lot of LiveEdit features in the authoring environment to edit sections, images, datasets, etc. in place.

The current implementation is TPP Snap and the URL to this script has to look like:

https://[your-firstspirit-server]/fs5webedit/snap.js

where [your-firstspirit-server] is the hostname of your FirstSpirit server (e.g. https://company.e-spirit.hosting) and fs5webedit the path of the ContentCreator WebApp (log in to your project in ContentCreator to see the path in your browsers address bar).

This path should be set as NUXT_PUBLIC_SNAP_URL` in your .env file. A fallback is the latest CDN version of this dependency which may cause a version mismatch and is not recommended.

NUXT_PUBLIC_LOG_LEVEL number optional

Possible log levels: 0 = Info, 1 = Log, 2 = Warning, 3 = Error, 4 = None. The default is 3.

You can also set the logLevel via app.config.ts

ENV variable will take the priority if set.

NUXT_PRIVATE_MAX_REFERENCE_DEPTH number optional

Due to performance reasons content references in your project get resolved up to a maximum reference depth of 10. Meaning a dataset refering to a dataset refering to a dataset …​ and so on. You can increase that number by specifying the NUXT_PRIVATE_MAX_REFERENCE_DEPTH variable.

NUXT_PUBLIC_ENABLE_EVENT_STREAM boolean optional

When enabled, events for insert, replace and delete CaaS documents can be observed and handled. It is only used in preview mode, to sync updated data in FirstSpirit with the CaaS and the App State.

NUXT_PUBLIC_DEFAULT_LOCALE string optional

Normally the current URL is used to find out the language. If this is not possible (for example, when a user calls /) the defaultLocale is used to retrieve the navigation data via the Content API. With this variable you can override the defaultLocale config from your app.config.ts file. The environment variable will take the priority.

app.config.ts file

The following settings allow easy configuration of the PWA through the app.config.ts file. Keep in mind that changes to the configuration of this file will be checked into version control.

defaultLocale string

Normally the current URL is used to find out the language. If this is not possible (for example, when a user calls /) the defaultLocale is used to retrieve the navigation data via the Content API. This property is required.

devMode boolean optional

The DevMode helps you to quickly build new components or adapt existing ones. See Getting Started for screenshots and more details.

logLevel number optional

Possible log levels: 0 = Debug, 1 = Info, 2 = Warning, 3 = Error, 4 = None. The default is 3.

You can also set the logLevel via ENV variable

ENV variable will take the priority if set, e.x. NUXT_PUBLIC_LOG_LEVEL=3

enableEventStream optional

When enabled, events for insert, replace and delete CaaS documents can be observed and handled. It’s currently used in preview mode, to sync updated data in FirstSpirit with the CaaS and the App State.

example app.config.ts

[source,javascript]

import { LogLevel } from 'fsxa-api' import { AppFileConfig } from './types'

const appConfig: AppFileConfig = { logLevel: LogLevel.NONE, devMode: false, defaultLocale: 'de_DE', enableEventStream: false }

export default defineAppConfig(appConfig)

##