Skip to content

Commit

Permalink
feat: ✨ introduces early access headers in stack config
Browse files Browse the repository at this point in the history
  • Loading branch information
nadeem-cs committed Nov 8, 2023
1 parent bdf9ad6 commit 2b3544d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export interface Config {
live_preview?: LivePreview;
plugins?: ContentstackPlugin[];
fetchOptions?: FetchOptions;
ea_headers?: string[]
}
// Stack Config
export interface StackConfig {
Expand Down
3 changes: 3 additions & 0 deletions src/core/stack.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ export default class Stack {
if (typeof stack_arguments[0].branch === "string" && stack_arguments[0].branch !== undefined) {
this.headers.branch = stack_arguments[0].branch
}
if (typeof stack_arguments[0].ea_headers == "object" && Array.isArray(stack_arguments[0].ea_headers) && stack_arguments[0].ea_headers.length > 0) {
this.headers['x-header-ea'] = stack_arguments[0].ea_headers.join(',')
}
this.environment = stack_arguments[0].environment;
return this;
} else {
Expand Down

0 comments on commit 2b3544d

Please sign in to comment.