Skip to content

Commit eda6565

Browse files
committed
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.
1 parent 0844b5b commit eda6565

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

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)