Skip to content

Commit 7293d6c

Browse files
authored
Fix: Add wildcard support for all Hygraph Studio domains (#8)
* Fix: Add wildcard support for all Hygraph Studio domains - Update default allowedOrigins to use wildcards (*.hygraph.com, *.hygraph.dev) - Fixes iframe communication issues with regional Studio domains - Supports custom Hygraph Studio deployments out of the box - Adds localhost:* wildcard for flexible local development This resolves the issue where the SDK would reject postMessage events from Studio instances running on regional or custom domains, causing the preview integration to fail silently. * Bump version to 1.0.4
1 parent 0844b5b commit 7293d6c

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@hygraph/preview-sdk",
3-
"version": "1.0.3",
3+
"version": "1.0.4",
44
"description": "Content preview SDK for seamless real-time content editing in Hygraph CMS",
55
"publishConfig": {
66
"access": "public"

src/core/Preview.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ export class Preview {
3737
updateDelay: 50,
3838
retryAttempts: 3,
3939
autoConnect: true,
40-
allowedOrigins: ['https://app.hygraph.com', 'http://localhost:3000'],
40+
allowedOrigins: [
41+
'https://*.hygraph.com',
42+
'https://*.hygraph.dev',
43+
'http://localhost:*',
44+
],
4145
...config,
4246
};
4347

0 commit comments

Comments
 (0)