Skip to content

Commit

Permalink
add CUSTOM_OPTIONS_PATH to env vars (#4769)
Browse files Browse the repository at this point in the history
  • Loading branch information
eastandwestwind authored Apr 2, 2024
1 parent 479a353 commit 4101e02
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ The types of changes are:
- Fixed select dropdowns being cut off by edges of modal forms [#4757](https://github.com/ethyca/fides/pull/4757)
- Changed "allow user to dismiss" toggle to show on config form for TCF experience [#4755](https://github.com/ethyca/fides/pull/4755)

### Added
- Adds CUSTOM_OPTIONS_PATH to Privacy Center env vars [#4769](https://github.com/ethyca/fides/pull/4769)


## [2.33.0](https://github.com/ethyca/fides/compare/2.32.0...2.33.0)

### Added
Expand Down
5 changes: 5 additions & 0 deletions clients/privacy-center/app/server-environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export interface PrivacyCenterSettings {
FIDES_STRING: string | null; // (optional) An explicitly passed-in string that supersedes the cookie. Can contain both TC and AC strings
IS_FORCED_TCF: boolean; // whether to force the privacy center to use the fides-tcf.js bundle
FIDES_JS_BASE_URL: string; // A base URL to a directory of fides.js scripts
CUSTOM_OPTIONS_PATH: string | null; // (optional) A custom path to fetch FidesOptions (e.g. "window.config.overrides"). Defaults to window.fides_overrides
PREVENT_DISMISSAL: boolean; // whether or not the user is allowed to dismiss the banner/overlay
ALLOW_HTML_DESCRIPTION: boolean | null; // (optional) whether or not HTML descriptions should be rendered
BASE_64_COOKIE: boolean; // whether or not to encode cookie as base64 on top of the default JSON string
Expand Down Expand Up @@ -84,6 +85,7 @@ export type PrivacyCenterClientSettings = Pick<
| "FIDES_STRING"
| "IS_FORCED_TCF"
| "FIDES_JS_BASE_URL"
| "CUSTOM_OPTIONS_PATH"
| "PREVENT_DISMISSAL"
| "ALLOW_HTML_DESCRIPTION"
| "BASE_64_COOKIE"
Expand Down Expand Up @@ -352,6 +354,8 @@ export const loadPrivacyCenterEnvironment =
FIDES_JS_BASE_URL:
process.env.FIDES_PRIVACY_CENTER__FIDES_JS_BASE_URL ||
"http://localhost:3000",
CUSTOM_OPTIONS_PATH:
process.env.FIDES_PRIVACY_CENTER__CUSTOM_OPTIONS_PATH || null,
PREVENT_DISMISSAL: process.env.FIDES_PRIVACY_CENTER__PREVENT_DISMISSAL
? process.env.FIDES_PRIVACY_CENTER__PREVENT_DISMISSAL === "true"
: false,
Expand Down Expand Up @@ -393,6 +397,7 @@ export const loadPrivacyCenterEnvironment =
FIDES_STRING: settings.FIDES_STRING,
IS_FORCED_TCF: settings.IS_FORCED_TCF,
FIDES_JS_BASE_URL: settings.FIDES_JS_BASE_URL,
CUSTOM_OPTIONS_PATH: settings.CUSTOM_OPTIONS_PATH,
PREVENT_DISMISSAL: settings.PREVENT_DISMISSAL,
ALLOW_HTML_DESCRIPTION: settings.ALLOW_HTML_DESCRIPTION,
BASE_64_COOKIE: settings.BASE_64_COOKIE,
Expand Down
2 changes: 1 addition & 1 deletion clients/privacy-center/pages/api/fides-js.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export default async function handler(
// Custom API override functions must be passed into custom Fides extensions via Fides.init(...)
apiOptions: null,
fidesJsBaseUrl: environment.settings.FIDES_JS_BASE_URL,
customOptionsPath: null,
customOptionsPath: environment.settings.CUSTOM_OPTIONS_PATH,
preventDismissal: environment.settings.PREVENT_DISMISSAL,
allowHTMLDescription: environment.settings.ALLOW_HTML_DESCRIPTION,
base64Cookie: environment.settings.BASE_64_COOKIE,
Expand Down

0 comments on commit 4101e02

Please sign in to comment.