Skip to content

Commit 0d1cb70

Browse files
authored
Merge pull request #19 from bc-jcha/MERC-5890
MERC-5890 Change naming WIDGET_BUILDER_STORE_HASH
2 parents e447f07 + edd27f4 commit 0d1cb70

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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

2020
You 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

src/services/api/widget.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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));

src/services/auth/auth.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import checkCredentials from './checkAuth';
33
describe('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
});

src/services/auth/authConfig.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
export interface AuthConfig {
2-
storeId?: string;
2+
storeHash?: string;
33
authId?: string;
44
authToken?: string;
55
}
66

77
const 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
};

0 commit comments

Comments
 (0)