I am using the embed SDK for Typescript and embedding my form on an Angular app.
I use Hotjar and in order for it to render iframe contents a property data-hj-allow-iframe must be passed to the iframe. While trying to add it I noticed only “style” prop can be provided. I think it’s a bug on the bindings but I am no expert in Typescript. Could anyone please verify?
I think the correct usage is to use camelCase instead of kebab-case for the attribute name. In your case it should be named dataHjAllowIframe like this:
in the embed SDK options you can find an option called iframeProps. All props provided here will be added to the iframe. In your case something like this:
I am using the typescript binding and seems like the only prop accepted is “style” as per the types.
The error on the highlighted line is:
1Type '{ 'data-hj-allow-iframe': string; }' is not assignable to type 'Partial<HTMLIFrameElementWithStyleString>'.
2 Object literal may only specify known properties, and ''data-hj-allow-iframe'' does not exist in type 'Partial<HTMLIFrameElementWithStyleString>'.ts(2322)
I should somehow be able to skip typescripts’s type validation and go straight to the JS embed SDK, but it doesn’t seem right.
Does that make any sense or am I just missing something? Sorry I am no expert in none of these languages.
I think the correct usage is to use camelCase instead of kebab-case for the attribute name. In your case it should be named dataHjAllowIframe like this:
I am using the embed SDK for Typescript and embedding my form on an Angular app.
I use Hotjar and in order for it to render iframe contents a property data-hj-allow-iframe must be passed to the iframe. While trying to add it I noticed only “style” prop can be provided. I think it’s a bug on the bindings but I am no expert in Typescript. Could anyone please verify?
in the embed SDK options you can find an option called iframeProps. All props provided here will be added to the iframe. In your case something like this:
I am using the typescript binding and seems like the only prop accepted is “style” as per the types.
The error on the highlighted line is:
1Type '{ 'data-hj-allow-iframe': string; }' is not assignable to type 'Partial<HTMLIFrameElementWithStyleString>'. Object literal may only specify known properties, and ''data-hj-allow-iframe'' does not exist in type 'Partial<HTMLIFrameElementWithStyleString>'.ts(2322)
I should somehow be able to skip typescripts’s type validation and go straight to the JS embed SDK, but it doesn’t seem right.
Does that make any sense or am I just missing something? Sorry I am no expert in none of these languages.
I think the correct usage is to use camelCase instead of kebab-case for the attribute name. In your case it should be named dataHjAllowIframe like this: