File tree Expand file tree Collapse file tree 4 files changed +7
-7
lines changed Expand file tree Collapse file tree 4 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -15,12 +15,12 @@ The widget builder reads the credentials from environment variables. You will ne
1515- ` WIDGET_BUILDER_AUTH_ID ` - The primary identifier of this set of credentials (Client ID).
1616- ` WIDGET_BUILDER_AUTH_TOKEN ` - The private authorization token (Auth token).
1717
18- - ` WIDGET_BUILDER_STORE_ID ` - The primary hash identifier of the store the credentials belong to.
18+ - ` WIDGET_BUILDER_STORE_HASH ` - The primary hash identifier of the store the credentials belong to.
1919
2020You can also run using a format like the following:
2121
2222```
23- WIDGET_BUILDER_AUTH_ID=REDACTED WIDGET_BUILDER_AUTH_TOKEN=REDACTED WIDGET_BUILDER_STORE_ID =REDACTED widget-builder
23+ WIDGET_BUILDER_AUTH_ID=REDACTED WIDGET_BUILDER_AUTH_TOKEN=REDACTED WIDGET_BUILDER_STORE_HASH =REDACTED widget-builder
2424```
2525
2626### Running the builder
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ export function getWidget(data: WidgetPreviewRenderRequest): Promise<string> {
3434 'X-Auth-Token' : AUTH_CONFIG . authToken ,
3535 } ,
3636 data,
37- url : widgetApi . widgetPreviewRender ( AUTH_CONFIG . storeId as string ) ,
37+ url : widgetApi . widgetPreviewRender ( AUTH_CONFIG . storeHash as string ) ,
3838 } ) . then ( ( response : AxiosResponse < WidgetPreviewRenderResponse > ) => {
3939 resolve ( response . data . data . html ) ;
4040 } ) . catch ( ( err : Error ) => reject ( err ) ) ;
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import checkCredentials from './checkAuth';
33describe ( 'Auth credential status check' , ( ) => {
44 it ( 'succeeds if credentials are present' , ( ) => {
55 const checkStatus = checkCredentials ( {
6- storeId : '123456' ,
6+ storeHash : '123456' ,
77 authId : 'abc123' ,
88 authToken : 'xyz456' ,
99 } ) ;
@@ -13,7 +13,7 @@ describe('Auth credential status check', () => {
1313
1414 it ( 'fails if any of the credentials are missing' , ( ) => {
1515 const checkStatus = checkCredentials ( {
16- storeId : '123456' ,
16+ storeHash : '123456' ,
1717 authId : 'abc123' ,
1818 authToken : '' ,
1919 } ) ;
Original file line number Diff line number Diff line change 11export interface AuthConfig {
2- storeId ?: string ;
2+ storeHash ?: string ;
33 authId ?: string ;
44 authToken ?: string ;
55}
66
77const AUTH_CONFIG : AuthConfig = {
8- storeId : process . env . WIDGET_BUILDER_STORE_ID ,
8+ storeHash : process . env . WIDGET_BUILDER_STORE_HASH ,
99 authId : process . env . WIDGET_BUILDER_AUTH_ID ,
1010 authToken : process . env . WIDGET_BUILDER_AUTH_TOKEN ,
1111} ;
You can’t perform that action at this time.
0 commit comments