{"_id":"@codatum/embed","_rev":"10-c8b1f3f6f405faa66af7fd4a6f591000","name":"@codatum/embed","dist-tags":{"latest":"1.0.0"},"versions":{"0.1.0":{"name":"@codatum/embed","version":"0.1.0","keywords":["codatum","embed","iframe","signed-embed","analytics","notebook"],"license":"Apache-2.0","_id":"@codatum/embed@0.1.0","maintainers":[{"name":"codatum-dev-share","email":"dev.share@codatum.dev"},{"name":"g0e","email":"masafumi.osogoe@codatum.dev"}],"homepage":"https://github.com/codatum/codatum-embed-js/tree/main/packages/embed#readme","bugs":{"url":"https://github.com/codatum/codatum-embed-js/issues"},"dist":{"shasum":"d17a08c23f7aeef14453adb5c0b90668e723551b","tarball":"https://registry.npmjs.org/@codatum/embed/-/embed-0.1.0.tgz","fileCount":10,"integrity":"sha512-tOIIoapYbUKllBbKKxTnYN51ZQWolFNmLlquIN6cyXB78LHa2nqYAj9UM3l2kEmhAv/YOUalVGX9quYX/+DVOg==","signatures":[{"sig":"MEUCIQD0W2iZa/NJ9AxUSCgJngKXZqf82kiJqcEjuBFsFETzaAIgC+yvuhfWuliOuFWUNtIhcUOdiVqsPkCZxugqiyx7isI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":242117},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"92c0a3425ef27b53b24f9730b8fc700e7a0fa89c","scripts":{"dev":"tsup --watch","lint":"biome lint .","test":"vitest run --coverage","build":"tsup && tsup --config tsup.global.config.ts","clean":"rm -rf dist","test:watch":"vitest"},"_npmUser":{"name":"g0e","email":"masafumi.osogoe@codatum.dev"},"repository":{"url":"git+https://github.com/codatum/codatum-embed-js.git","type":"git","directory":"packages/embed"},"_npmVersion":"11.4.2","description":"TypeScript library for Codatum signed embedding","directories":{},"_nodeVersion":"24.3.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"catalog:","jsdom":"catalog:","vitest":"catalog:","typescript":"catalog:","@vitest/coverage-v8":"catalog:"},"_npmOperationalInternal":{"tmp":"tmp/embed_0.1.0_1771568469768_0.8699061875687464","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@codatum/embed","version":"0.1.1","keywords":["codatum","embed","iframe","signed-embed","analytics","notebook"],"license":"Apache-2.0","_id":"@codatum/embed@0.1.1","maintainers":[{"name":"codatum-dev-share","email":"dev.share@codatum.dev"},{"name":"g0e","email":"masafumi.osogoe@codatum.dev"}],"homepage":"https://github.com/codatum/codatum-embed-js/tree/main/packages/embed#readme","bugs":{"url":"https://github.com/codatum/codatum-embed-js/issues"},"dist":{"shasum":"d54b03068d21d5dbc193dc3b2f5468fd683eeb63","tarball":"https://registry.npmjs.org/@codatum/embed/-/embed-0.1.1.tgz","fileCount":10,"integrity":"sha512-ixdLAn93VTZLU/+8+w309DSNVtBzWPWPOib5QYDsibI+kJUX1U8bC0ZCfopRnkDQT1o3u/7l7r2qGvQ0IRIjEA==","signatures":[{"sig":"MEUCIQCjHyI4GKE2SOhyFjcatmt5oawAiXoBU6w3Q2+Y8y0vOwIgMF4TRZBIiOSPYCEUhiSJmiuM4oRkDeneRsMWrYAspoA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@codatum%2fembed@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":242117},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"06f2a1233f62760795b8e381bb9178a14ce28c13","scripts":{"dev":"tsup --watch","lint":"biome lint .","test":"vitest run --coverage","build":"tsup && tsup --config tsup.global.config.ts","clean":"rm -rf dist","test:watch":"vitest"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:76fe223b-5dc2-411c-a106-6c1412fac64c"}},"repository":{"url":"git+https://github.com/codatum/codatum-embed-js.git","type":"git","directory":"packages/embed"},"_npmVersion":"11.6.2","description":"TypeScript library for Codatum signed embedding","directories":{},"_nodeVersion":"24.13.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"catalog:","jsdom":"catalog:","vitest":"catalog:","typescript":"catalog:","@vitest/coverage-v8":"catalog:"},"_npmOperationalInternal":{"tmp":"tmp/embed_0.1.1_1771649617427_0.3348231325668891","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@codatum/embed","version":"0.1.2","keywords":["codatum","embed","iframe","signed-embed","analytics","notebook"],"license":"Apache-2.0","_id":"@codatum/embed@0.1.2","maintainers":[{"name":"codatum-dev-share","email":"dev.share@codatum.dev"},{"name":"g0e","email":"masafumi.osogoe@codatum.dev"}],"homepage":"https://github.com/codatum/codatum-embed-js/tree/main/packages/embed#readme","bugs":{"url":"https://github.com/codatum/codatum-embed-js/issues"},"dist":{"shasum":"2a30f64b71e05f758c7a3ec71fe9fab19867c5f8","tarball":"https://registry.npmjs.org/@codatum/embed/-/embed-0.1.2.tgz","fileCount":11,"integrity":"sha512-NHR7jnnnJBUd+1lsJf5GdzJmzZQuVmX8JeTs4ptnnfNhvcUWKehA5ZxrABHo1wNFHXJwXnlPIRBvayDuKd4xfg==","signatures":[{"sig":"MEQCIBXxNJDfBAjT3C71hRjApbqCR3eVY259xgd5VUp8R5MyAiB275NgQ+V8F7UvDItz6hAYeI8Dxo3yO+QPfpQALYrKvQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@codatum%2fembed@0.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":253451},"main":"./dist/index.cjs","type":"module","_from":"file:codatum-embed-0.1.2.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"dev":"tsup --watch","lint":"biome lint .","test":"vitest run --coverage","build":"tsup && tsup --config tsup.global.config.ts","clean":"rm -rf dist","test:watch":"vitest"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:76fe223b-5dc2-411c-a106-6c1412fac64c"}},"_resolved":"/tmp/25ad19d2670dfda9c93995abc991c96a/codatum-embed-0.1.2.tgz","_integrity":"sha512-NHR7jnnnJBUd+1lsJf5GdzJmzZQuVmX8JeTs4ptnnfNhvcUWKehA5ZxrABHo1wNFHXJwXnlPIRBvayDuKd4xfg==","repository":{"url":"git+https://github.com/codatum/codatum-embed-js.git","type":"git","directory":"packages/embed"},"_npmVersion":"11.6.2","description":"TypeScript library for Codatum signed embedding","directories":{},"_nodeVersion":"24.13.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","jsdom":"^28.1.0","vitest":"^4.0.18","typescript":"^5.0.0","@vitest/coverage-v8":"^4.0.18"},"_npmOperationalInternal":{"tmp":"tmp/embed_0.1.2_1771657170841_0.3406423289331182","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@codatum/embed","version":"0.2.0","keywords":["codatum","embed","iframe","signed-embed","analytics","notebook"],"license":"Apache-2.0","_id":"@codatum/embed@0.2.0","maintainers":[{"name":"codatum-dev-share","email":"dev.share@codatum.dev"},{"name":"g0e","email":"masafumi.osogoe@codatum.dev"}],"homepage":"https://github.com/codatum/codatum-embed-js/tree/main/packages/embed#readme","bugs":{"url":"https://github.com/codatum/codatum-embed-js/issues"},"dist":{"shasum":"7afeef81c27b49abbea0c270e15dac8d4602979b","tarball":"https://registry.npmjs.org/@codatum/embed/-/embed-0.2.0.tgz","fileCount":11,"integrity":"sha512-3WCovp+1wkQDB26tNemM86YneseoW4uOAstpI9iOmacY7KhhrTc13MOzJOkwFKIop6x8hk9V+Y5dOSM3I8FTDw==","signatures":[{"sig":"MEYCIQDDxpbJ0USc6FeAB3FYlxiBsigqHKF+yeTdCpShlY2KtQIhAId7F7dvqHkGf3laB+e4ce3tpVpg+3KGBzM+OcBjrCz3","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@codatum%2fembed@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":298800},"main":"./dist/index.cjs","type":"module","_from":"file:codatum-embed-0.2.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"dev":"tsup --watch","lint":"biome lint .","test":"vitest run --coverage","build":"tsup && tsup --config tsup.global.config.ts","clean":"rm -rf dist","test:watch":"vitest"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:76fe223b-5dc2-411c-a106-6c1412fac64c"}},"_resolved":"/tmp/53bf9998a94cedd551930584e8ae00e2/codatum-embed-0.2.0.tgz","_integrity":"sha512-3WCovp+1wkQDB26tNemM86YneseoW4uOAstpI9iOmacY7KhhrTc13MOzJOkwFKIop6x8hk9V+Y5dOSM3I8FTDw==","repository":{"url":"git+https://github.com/codatum/codatum-embed-js.git","type":"git","directory":"packages/embed"},"_npmVersion":"11.6.2","description":"TypeScript library for Codatum signed embedding","directories":{},"_nodeVersion":"24.13.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","jsdom":"^28.1.0","vitest":"^4.0.18","typescript":"^5.0.0","@vitest/coverage-v8":"^4.0.18"},"_npmOperationalInternal":{"tmp":"tmp/embed_0.2.0_1771738837943_0.5115513073399225","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@codatum/embed","version":"0.3.0","keywords":["codatum","embed","iframe","signed-embed","analytics","notebook"],"license":"Apache-2.0","_id":"@codatum/embed@0.3.0","maintainers":[{"name":"codatum-dev-share","email":"dev.share@codatum.dev"},{"name":"g0e","email":"masafumi.osogoe@codatum.dev"}],"homepage":"https://github.com/codatum/codatum-embed-js/tree/main/packages/embed#readme","bugs":{"url":"https://github.com/codatum/codatum-embed-js/issues"},"dist":{"shasum":"22e21d4495e47a2dfe0ac1765e711b40391cdd48","tarball":"https://registry.npmjs.org/@codatum/embed/-/embed-0.3.0.tgz","fileCount":11,"integrity":"sha512-yIxkZOOu8keoMtwcttRP2hiHN7F5tDfnkj/UMGNp1V7WF6g+nOoQAG7wSaBf6/82Pkd9uDw8R4ZD6FeLNrsABw==","signatures":[{"sig":"MEYCIQDcWMvdJP7M82CtAjMklQeuUM0TAwR/K7JBSrk3pEPGgQIhAL42rAVxJoYQhNHPZJDc6G+XvYn8JsAb8SQUN3Rh9fq0","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@codatum%2fembed@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":303288},"main":"./dist/index.cjs","type":"module","_from":"file:codatum-embed-0.3.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20.12"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"dev":"tsup --watch","lint":"biome lint .","test":"vitest run --coverage","build":"tsup && tsup --config tsup.global.config.ts","clean":"rm -rf dist","test:watch":"vitest"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:76fe223b-5dc2-411c-a106-6c1412fac64c"}},"_resolved":"/tmp/c03c1c3a4a305760b9a67f5c9cd0b50e/codatum-embed-0.3.0.tgz","_integrity":"sha512-yIxkZOOu8keoMtwcttRP2hiHN7F5tDfnkj/UMGNp1V7WF6g+nOoQAG7wSaBf6/82Pkd9uDw8R4ZD6FeLNrsABw==","repository":{"url":"git+https://github.com/codatum/codatum-embed-js.git","type":"git","directory":"packages/embed"},"_npmVersion":"11.6.2","description":"TypeScript library for Codatum signed embedding","directories":{},"_nodeVersion":"24.13.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","jsdom":"^28.1.0","vitest":"^4.0.18","typescript":"^5.0.0","@vitest/coverage-v8":"^4.0.18"},"_npmOperationalInternal":{"tmp":"tmp/embed_0.3.0_1771909787830_0.04650606678292046","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@codatum/embed","version":"0.4.0","keywords":["codatum","embed","iframe","signed-embed","analytics","notebook"],"license":"Apache-2.0","_id":"@codatum/embed@0.4.0","maintainers":[{"name":"codatum-dev-share","email":"dev.share@codatum.dev"},{"name":"g0e","email":"masafumi.osogoe@codatum.dev"}],"homepage":"https://github.com/codatum/codatum-embed-js/tree/main/packages/embed#readme","bugs":{"url":"https://github.com/codatum/codatum-embed-js/issues"},"dist":{"shasum":"903acc5abe319afb7ebd17a614e369cbe753715c","tarball":"https://registry.npmjs.org/@codatum/embed/-/embed-0.4.0.tgz","fileCount":11,"integrity":"sha512-GdY1QLjB/kOVVCe2kzX+xMlGdQCBx0mnICd28hD1l37xsI3+iEE2BrJKxo6wM1LjhhmmszHGU4HCekI8d/DNUQ==","signatures":[{"sig":"MEQCIBgZWfI4dL5agW3v3HAI0uXWnI/Rc7FCFDBKGYQbcP2iAiAfRXEQiG84/wkD/Puu7a1oehoIf4qAItoHGatfES+OWg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@codatum%2fembed@0.4.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":329654},"main":"./dist/index.cjs","type":"module","_from":"file:codatum-embed-0.4.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20.12"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"dev":"tsup --watch","lint":"biome lint .","test":"vitest run --coverage","build":"tsup && tsup --config tsup.global.config.ts","clean":"rm -rf dist","test:watch":"vitest"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:76fe223b-5dc2-411c-a106-6c1412fac64c"}},"_resolved":"/tmp/1192de49d900022cc7994da952f36692/codatum-embed-0.4.0.tgz","_integrity":"sha512-GdY1QLjB/kOVVCe2kzX+xMlGdQCBx0mnICd28hD1l37xsI3+iEE2BrJKxo6wM1LjhhmmszHGU4HCekI8d/DNUQ==","repository":{"url":"git+https://github.com/codatum/codatum-embed-js.git","type":"git","directory":"packages/embed"},"_npmVersion":"11.8.0","description":"TypeScript library for Codatum signed embedding","directories":{},"_nodeVersion":"24.13.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","jsdom":"^28.1.0","vitest":"^4.0.18","typescript":"^5.0.0","@vitest/coverage-v8":"^4.0.18"},"_npmOperationalInternal":{"tmp":"tmp/embed_0.4.0_1772411891812_0.5227519924969448","host":"s3://npm-registry-packages-npm-production"}},"0.5.0":{"name":"@codatum/embed","version":"0.5.0","keywords":["codatum","embed","iframe","signed-embed","analytics","notebook"],"license":"Apache-2.0","_id":"@codatum/embed@0.5.0","maintainers":[{"name":"codatum-dev-share","email":"dev.share@codatum.dev"},{"name":"g0e","email":"masafumi.osogoe@codatum.dev"}],"homepage":"https://github.com/codatum/codatum-embed-js/tree/main/packages/embed#readme","bugs":{"url":"https://github.com/codatum/codatum-embed-js/issues"},"dist":{"shasum":"1f516b404233b6d4540de8c87197787b14d2c7bc","tarball":"https://registry.npmjs.org/@codatum/embed/-/embed-0.5.0.tgz","fileCount":11,"integrity":"sha512-EMZYW2tLI/37/Xb5FYRU6S+fvW/ZsBhGHTCrBhswWHu2zALUHHQtzziTOsv+rAwc0B6MISb+xdntUogQt6uQdg==","signatures":[{"sig":"MEYCIQCdhOu2Z8dvASMjpj9IpmRILF1wXFKpeeJ3qZbbRJ+YKAIhAKakqtqof8NKufVTAsMe3krpbPb3nP53vsAlQi+4S1nm","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@codatum%2fembed@0.5.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":336081},"main":"./dist/index.cjs","type":"module","_from":"file:codatum-embed-0.5.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20.12"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"dev":"tsup --watch","lint":"biome lint .","test":"vitest run --coverage","build":"tsup && tsup --config tsup.global.config.ts","clean":"rm -rf dist","test:watch":"vitest"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:76fe223b-5dc2-411c-a106-6c1412fac64c"}},"_resolved":"/tmp/ade85afe5dbd1c4c6e5603525dc3d2a8/codatum-embed-0.5.0.tgz","_integrity":"sha512-EMZYW2tLI/37/Xb5FYRU6S+fvW/ZsBhGHTCrBhswWHu2zALUHHQtzziTOsv+rAwc0B6MISb+xdntUogQt6uQdg==","repository":{"url":"git+https://github.com/codatum/codatum-embed-js.git","type":"git","directory":"packages/embed"},"_npmVersion":"11.8.0","description":"TypeScript library for Codatum signed embedding","directories":{},"_nodeVersion":"24.13.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","jsdom":"^28.1.0","vitest":"^4.0.18","typescript":"^5.0.0","@vitest/coverage-v8":"^4.0.18"},"_npmOperationalInternal":{"tmp":"tmp/embed_0.5.0_1772487506105_0.8816510947805163","host":"s3://npm-registry-packages-npm-production"}},"0.5.1":{"name":"@codatum/embed","version":"0.5.1","keywords":["codatum","embed","iframe","signed-embed","analytics","notebook"],"license":"Apache-2.0","_id":"@codatum/embed@0.5.1","maintainers":[{"name":"codatum-dev-share","email":"dev.share@codatum.dev"},{"name":"g0e","email":"masafumi.osogoe@codatum.dev"}],"homepage":"https://github.com/codatum/codatum-embed-js/tree/main/packages/embed#readme","bugs":{"url":"https://github.com/codatum/codatum-embed-js/issues"},"dist":{"shasum":"6e00818e8c74420fb86be66eeeec08a4a7b9559d","tarball":"https://registry.npmjs.org/@codatum/embed/-/embed-0.5.1.tgz","fileCount":11,"integrity":"sha512-OlN/LdQael1tEHlRR1k5/6euo90doBAjSGBnE46iFTrQckUyMfdbKDKWiNI9U6MZUT3kMg+dRQe0FaOQ7N/hqw==","signatures":[{"sig":"MEYCIQDFKDXKpmtnVrnoJwfMRJ4Z67g5R4f9ub82kJI/E4LurwIhAO2WJrkn+Jp4KP6BKyk2MoHw6VMw+NAmfB44+uw67a6m","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@codatum%2fembed@0.5.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":344928},"main":"./dist/index.cjs","type":"module","_from":"file:codatum-embed-0.5.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20.12"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"dev":"tsup --watch","lint":"biome lint .","test":"vitest run --coverage","build":"tsup && tsup --config tsup.global.config.ts","clean":"rm -rf dist","test:watch":"vitest"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:76fe223b-5dc2-411c-a106-6c1412fac64c"}},"_resolved":"/tmp/d1b0571029faa573662b3d0d829e9333/codatum-embed-0.5.1.tgz","_integrity":"sha512-OlN/LdQael1tEHlRR1k5/6euo90doBAjSGBnE46iFTrQckUyMfdbKDKWiNI9U6MZUT3kMg+dRQe0FaOQ7N/hqw==","repository":{"url":"git+https://github.com/codatum/codatum-embed-js.git","type":"git","directory":"packages/embed"},"_npmVersion":"11.8.0","description":"TypeScript library for Codatum signed embedding","directories":{},"_nodeVersion":"24.13.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","jsdom":"^28.1.0","vitest":"^4.0.18","typescript":"^5.0.0","@vitest/coverage-v8":"^4.0.18"},"_npmOperationalInternal":{"tmp":"tmp/embed_0.5.1_1772494307744_0.34642443893321717","host":"s3://npm-registry-packages-npm-production"}},"0.5.2":{"name":"@codatum/embed","version":"0.5.2","keywords":["codatum","embed","iframe","signed-embed","analytics","notebook"],"license":"Apache-2.0","_id":"@codatum/embed@0.5.2","maintainers":[{"name":"codatum-dev-share","email":"dev.share@codatum.dev"},{"name":"g0e","email":"masafumi.osogoe@codatum.dev"}],"homepage":"https://github.com/codatum/codatum-embed-js/tree/main/packages/embed#readme","bugs":{"url":"https://github.com/codatum/codatum-embed-js/issues"},"dist":{"shasum":"a2c8333075ebe02006e96a6c06a2bf229d46218e","tarball":"https://registry.npmjs.org/@codatum/embed/-/embed-0.5.2.tgz","fileCount":11,"integrity":"sha512-kz8BM7AyelZRcLkE/Nw4sKnAjJbSbi2tb12D7AO9478I+N9EUR0/tV5w/z/qH2B6mL25VGLZVVDn1JVOTrfQ9g==","signatures":[{"sig":"MEUCIQDl8Q/XQ5k65ufA0a6X2jY+Z2JK/9hdY+EGjlNBQEoXmAIgFQ4tfcyTvkBfXHQ0MOadQg1Ir8MiQUVm2DPy1/vukxw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@codatum%2fembed@0.5.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":344928},"main":"./dist/index.cjs","type":"module","_from":"file:codatum-embed-0.5.2.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20.12"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"dev":"tsup --watch","lint":"biome lint .","test":"vitest run --coverage","build":"tsup && tsup --config tsup.global.config.ts","clean":"rm -rf dist","test:watch":"vitest"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:76fe223b-5dc2-411c-a106-6c1412fac64c"}},"_resolved":"/tmp/0c38ee62379425c6366cffb643c77de2/codatum-embed-0.5.2.tgz","_integrity":"sha512-kz8BM7AyelZRcLkE/Nw4sKnAjJbSbi2tb12D7AO9478I+N9EUR0/tV5w/z/qH2B6mL25VGLZVVDn1JVOTrfQ9g==","repository":{"url":"git+https://github.com/codatum/codatum-embed-js.git","type":"git","directory":"packages/embed"},"_npmVersion":"11.8.0","description":"TypeScript library for Codatum signed embedding","directories":{},"_nodeVersion":"24.13.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","jsdom":"^28.1.0","vitest":"^4.0.18","typescript":"^5.0.0","@vitest/coverage-v8":"^4.0.18"},"_npmOperationalInternal":{"tmp":"tmp/embed_0.5.2_1772500568507_0.5172185970456031","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"@codatum/embed","version":"1.0.0","description":"TypeScript library for Codatum signed embedding","type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"devDependencies":{"@vitest/coverage-v8":"^4.0.18","jsdom":"^28.1.0","tsup":"^8.5.0","typescript":"^5.0.0","vitest":"^4.0.18"},"engines":{"node":">=20.12"},"license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/codatum/codatum-embed-js.git","directory":"packages/embed"},"homepage":"https://github.com/codatum/codatum-embed-js/tree/main/packages/embed#readme","bugs":{"url":"https://github.com/codatum/codatum-embed-js/issues"},"keywords":["codatum","embed","iframe","signed-embed","analytics","notebook"],"publishConfig":{"access":"public"},"scripts":{"build":"tsup && tsup --config tsup.global.config.ts","dev":"tsup --watch","test":"vitest run --coverage","test:watch":"vitest","lint":"biome lint .","clean":"rm -rf dist"},"_id":"@codatum/embed@1.0.0","_integrity":"sha512-CLwMc5L0yYZWCiabr9OwODxymCSBmY7D+p9DDh6LQ02kb17/JaIHt+PXjP8TsB3gWj4ndrWnW/dHZlgSKfMC4w==","_resolved":"/tmp/0a59bc19830e0fbc3c9275569539dc72/codatum-embed-1.0.0.tgz","_from":"file:codatum-embed-1.0.0.tgz","_nodeVersion":"24.13.1","_npmVersion":"11.8.0","dist":{"integrity":"sha512-CLwMc5L0yYZWCiabr9OwODxymCSBmY7D+p9DDh6LQ02kb17/JaIHt+PXjP8TsB3gWj4ndrWnW/dHZlgSKfMC4w==","shasum":"7418e9bac6ef6c9a32971cb7a98dc625cd99feda","tarball":"https://registry.npmjs.org/@codatum/embed/-/embed-1.0.0.tgz","fileCount":11,"unpackedSize":344928,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@codatum%2fembed@1.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDgkD1NoLXSSssdpVzu/VDB341Uc7vzTOwzltaG9ReRmwIhANs3moqvuFs/SbWKBk1Kkq7jGuJ00H6dU2RrA2WbhYXG"}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:76fe223b-5dc2-411c-a106-6c1412fac64c"}},"directories":{},"maintainers":[{"name":"codatum-dev-share","email":"dev.share@codatum.dev"},{"name":"g0e","email":"masafumi.osogoe@codatum.dev"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/embed_1.0.0_1772506793008_0.6679311864651827"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-20T06:21:09.641Z","modified":"2026-03-03T02:59:53.534Z","0.1.0":"2026-02-20T06:21:09.906Z","0.1.1":"2026-02-21T04:53:37.569Z","0.1.2":"2026-02-21T06:59:31.000Z","0.2.0":"2026-02-22T05:40:38.115Z","0.3.0":"2026-02-24T05:09:47.990Z","0.4.0":"2026-03-02T00:38:11.967Z","0.5.0":"2026-03-02T21:38:26.283Z","0.5.1":"2026-03-02T23:31:47.962Z","0.5.2":"2026-03-03T01:16:08.647Z","1.0.0":"2026-03-03T02:59:53.245Z"},"bugs":{"url":"https://github.com/codatum/codatum-embed-js/issues"},"license":"Apache-2.0","homepage":"https://github.com/codatum/codatum-embed-js/tree/main/packages/embed#readme","keywords":["codatum","embed","iframe","signed-embed","analytics","notebook"],"repository":{"type":"git","url":"git+https://github.com/codatum/codatum-embed-js.git","directory":"packages/embed"},"description":"TypeScript library for Codatum signed embedding","maintainers":[{"name":"codatum-dev-share","email":"dev.share@codatum.dev"},{"name":"g0e","email":"masafumi.osogoe@codatum.dev"}],"readme":"# @codatum/embed\n\nCore TypeScript SDK for embedding Codatum Notebook with [signed embed](https://docs.codatum.com/sharing/signed-embed): create the iframe in the browser, pass a token from your backend, handle parameters and events. Server-side token issuance is out of scope.\n\n**Docs**: [Signed embed](https://docs.codatum.com/sharing/signed-embed) · [Integration](https://docs.codatum.com/sharing/signed-embed/integration) · [Use cases](https://docs.codatum.com/sharing/signed-embed/use-case). **Wrappers**: [@codatum/embed-react](https://github.com/codatum/codatum-embed-js/tree/main/packages/embed-react#readme), [@codatum/embed-vue](https://github.com/codatum/codatum-embed-js/tree/main/packages/embed-vue#readme).\n\n## Installation\n\n```bash\npnpm add @codatum/embed\n# or\nnpm install @codatum/embed\n```\n\n## Quick start\n\n```ts\nimport { createEmbed } from '@codatum/embed';\n\nconst embed = createEmbed({\n  container: '#dashboard',\n  embedUrl: 'https://app.codatum.com/protected/workspace/xxx/notebook/yyy',\n  tokenProvider: async () => {\n    // Issue a token in your backend and fetch it here\n    const res = await fetch('/api/codatum/token', { method: 'POST' });\n    const data = await res.json();\n    return { token: data.token };\n  },\n});\nawait embed.init();\n\n// cleanup\nembed.destroy();\n```\n\n## Embed\n\n### `EmbedOptions`\n\n| Property | Required | Description |\n|--------|----------|-------------|\n| `container` | Yes | `HTMLElement` or CSS selector where the iframe is inserted |\n| `embedUrl` | Yes | Signed embed URL from Codatum |\n| `tokenProvider` | Yes | See [tokenProvider](#tokenprovider) below |\n| `iframeOptions` | No | See [IframeOptions](#iframeoptions) below |\n| `tokenOptions` | No | See [TokenOptions](#tokenoptions) below |\n| `displayOptions` | No | See [DisplayOptions](#displayoptions) below |\n| `devOptions` | No | See [DevOptions](#devoptions) below |\n\n#### `tokenProvider`\n\nRequired callback that issues a token from your backend and returns it (and optionally `params`). Called on `init()`, `reload()`, and when the token is about to expire (unless `tokenOptions.disableRefresh` is `true`).\n\n**Signature:** `(context: TokenProviderContext) => Promise<{ token: string; params?: EncodedParam[] }>`\n\n- **`context.trigger`** — `'INIT'` | `'RELOAD'` | `'REFRESH'`.\n- **`context.markNonRetryable()`** — Call on failure to skip retries (ignores `tokenOptions.retryCount`).\n- **`params`** — Optional. If returned, sent to the embed with the token; use [ParamMapper](#parammapper) `encode()` to build.\n\n**Example:**\n\n```ts\ntokenProvider: async (context) => {\n  const res = await fetch('/api/codatum/token', {\n    method: 'POST',\n    body: JSON.stringify({ tenant_id: currentUser.tenantId }),\n  });\n  if (!res.ok) {\n    if (res.status === 401) context.markNonRetryable();\n    throw new Error(`Token failed: ${res.status}`);\n  }\n  const data = await res.json();\n  const params = paramMapper.encode({ \n    store_id: currentUser.defaultStoreId,\n    date_range: ['2025-01-01', '2025-01-31']\n  });\n  return { token: data.token, params };\n}\n```\n\n#### `IframeOptions`\n\nOptions applied to the iframe element and passed to the embed via URL/search params.\n\n| Property | Type | Default | Description |\n|----------|------|---------|-------------|\n| `theme` | `'LIGHT'` \\| `'DARK'`\\| `'SYSTEM'` | `'SYSTEM'` | UI theme of the embedded notebook |\n| `locale` | `string` | Browser's locale | Locale code (e.g. `'en'`, `'ja'`) for the embed UI |\n| `className` | `string` | - | CSS class name(s) applied to the iframe element |\n| `style` | `object` | `{display: 'block', width: '100%', height: '100%', border: 'none'}` | Inline styles for the iframe; overrides the default styles |\n| `attrs` | `Record<string, string>` | - | Additional HTML attributes for the iframe (e.g. `{ title: 'Dashboard', 'data-testid': 'embed-iframe' }`) |\n\n#### `TokenOptions`\n\nControls token lifetime, refresh behavior, and loading timeout.\n\n| Property | Type | Default | Description |\n|----------|------|---------|-------------|\n| `disableRefresh` | `boolean` | `false` | When `true`, disables automatic token refresh before the token expires |\n| `refreshBuffer` | `number` | `60` | Number of seconds before the token expires when auto-refresh is triggered |\n| `retryCount` | `number` | `2` | Number of retries on token fetch failure; `0` = no retry |\n| `loadingTimeout` | `number` | `30` | Max wait in seconds for `CONTENT_READY` after entering `INITIALIZING`, `RELOADING`, or `REFRESHING`; `0` = no timeout |\n| `onRefreshError` | `(error: EmbedError) => void` | `undefined` | Callback invoked when token auto-refresh fails (due to `tokenProvider` failure or loading timeout) and does not recover after all retries |\n\n#### `DisplayOptions`\n\nSent to the embed with the token.\n\n| Property | Type | Default | Description |\n|----------|------|---------|-------------|\n| `sqlDisplay` | `'SHOW'` \\| `'RESULT_ONLY'` \\| `'HIDE'` | `'SHOW'` | Whether to show SQL Blocks, results only, or hide |\n| `hideParamsForm` | `boolean` | `false` | Hide the parameter form in the embed (e.g. when your app owns the filters) |\n| `expandParamsFormByDefault` | `boolean` | `false` | Whether the parameter form is expanded by default |\n\n#### `DevOptions`\n\nDevelopment and testing only. Not intended for production.\n\n| Property | Type | Default | Description |\n|----------|------|---------|-------------|\n| `debug` | `boolean` | `false` | When `true`, logs SDK lifecycle: postMessage (in/out), tokenProvider calls/refresh/retries, status transitions. |\n| `disableValidateUrl` | `boolean` | `false` | When `true`, skips `embedUrl` format validation (domain/path). Use for local or staging URLs that don't match the production pattern. |\n| `mock` | `boolean` \\| `MockOptions` | - | Enables mock mode: no real embed load, no network. iframe uses `srcdoc` with a styled placeholder. |\n\n**MockOptions** (when `mock` is an object):\n\n| Property | Type | Default | Description |\n|----------|------|---------|-------------|\n| `label` | `string` | `embedUrl` | Text shown in the mock iframe placeholder. Useful when multiple embeds are on the page. |\n| `callTokenProvider` | `boolean` | `false` | When `true`, calls `tokenProvider` on `init()`, `reload()`, and auto-refresh. |\n| `loadingDelay` | `number` | `0` | Delay in seconds before the embed is loaded. Useful for testing loading UI. |\n\n### Creating an embed instance\n\n**`createEmbed(options: EmbedOptions): EmbedInstance`**\n\nCreates an embed instance. Throws `EmbedError` if options are invalid. Call `init()` to create the iframe and start the token flow.\n\n### Instance methods\n\n| Method | Description |\n|--------|-------------|\n| `async init()` | Creates the iframe, waits for it to be ready, calls `tokenProvider`, and sends token (and optional params) to the embed. Resolves when the embed sends `CONTENT_READY`. Rejects with `EmbedError` on failure. |\n| `async reload()` | Calls `tokenProvider`, sends the returned token and params via `SET_TOKEN`, and resolves when the embed sends `CONTENT_READY`. Rejects with `EmbedError` on failure. |\n| `destroy()` | Removes iframe, clears listeners and timers. No-op if already destroyed. |\n\n### Instance properties\n\n| Property | Type | Description |\n|----------|------|-------------|\n| `iframe` | `HTMLIFrameElement \\| null` | The embed iframe element. |\n| `status` | `'CREATED' \\| 'INITIALIZING' \\| 'RELOADING' \\| 'REFRESHING' \\| 'READY' \\| 'DESTROYED'` | Current instance state. |\n\n### Container attribute\n\nThe SDK sets a `data-codatum-embed-status` attribute on the container element, reflecting the current status. The attribute is added when `init()` is called and removed on `destroy()`. Use it for CSS-based styling or E2E test selectors.\n\n| Status | When |\n|--------|------|\n| `INITIALIZING` | `init()` called, waiting for content |\n| `READY` | Content loaded and visible |\n| `RELOADING` | `reload()` called, waiting for content |\n| `REFRESHING` | Auto-refresh in progress |\n| `DESTROYED` | (attribute removed) |\n\n#### Example: Custom loading UI\n\nShow your own loading indicator during initialization while keeping the iframe hidden:\n```html\n<div id=\"dashboard\" style=\"position: relative;\">\n  <div class=\"my-loading\">Loading…</div>\n</div>\n```\n```css\n/* Hide iframe and show loading UI while loading */\n[data-codatum-embed-status=\"INITIALIZING\"] iframe,\n[data-codatum-embed-status=\"RELOADING\"] iframe,\n[data-codatum-embed-status=\"REFRESHING\"] iframe {\n  visibility: hidden;\n}\n[data-codatum-embed-status=\"INITIALIZING\"] .my-loading,\n[data-codatum-embed-status=\"RELOADING\"] .my-loading,\n[data-codatum-embed-status=\"REFRESHING\"] .my-loading {\n  display: flex;\n  position: absolute;\n  inset: 0;\n  align-items: center;\n  justify-content: center;\n}\n\n/* Hide loading UI when ready */\n[data-codatum-embed-status=\"READY\"] .my-loading {\n  display: none;\n}\n```\n\nWithout any custom CSS, the embed's built-in loading screen is shown as-is inside the iframe.\n\n### Events\n\nSubscribe with `on(event, handler)` and `off(event, handler)`.\n\n| Event | Description | Payload |\n|-------|-------------|---------|\n| `statusChanged` | Instance status changed. | `{ type: 'STATUS_CHANGED', status: EmbedStatus, previousStatus: EmbedStatus }` |\n| `paramChanged` | User changed parameters in the embed. | `{ type: 'PARAM_CHANGED', params: EncodedParam[] }` |\n| `executeSqlsTriggered` | SQL execution was triggered in the embed. | `{ type: 'EXECUTE_SQLS_TRIGGERED', params: EncodedParam[] }` |\n| `executionSucceeded` | SQL execution was completed successfully. | `{ type: 'EXECUTION_SUCCEEDED' }` |\n| `executionFailed` | SQL execution was failed. | `{ type: 'EXECUTION_FAILED', errorMessage: string }` |\n\nDecode with `ParamMapper.decode(payload.params)`. `EncodedParam`: see [ParamMapper](#parammapper).\n\n## ParamMapper\n\nThe embed uses `param_id`s (IDs assigned per notebook parameter). Your app typically works with meaningful keys such as `store_id` or `date_range`. **ParamMapper** maps between your app's key–value pairs and Codatum's `param_id` + `param_value` in both directions.\n\n### Basic usage\n\n```ts\nimport { createParamMapper } from '@codatum/embed';\n\nconst paramMapper = createParamMapper({\n  store_id: '67a1b2c3d4e5f6a7b8c9d0e1',\n  date_range: '67a1b2c3d4e5f6a7b8c9d0e2',\n  product_category: '67a1b2c3d4e5f6a7b8c9d0e3',\n});\n\nconst appState = {\n  store_id: 'store_001',\n  date_range: ['2025-01-01', '2025-01-31'],\n  product_category: ['Electronics'],\n};\n\n// encode: app key:value → EncodedParam[] (use in tokenProvider return)\nparamMapper.encode(appState);\n// → [\n//   { param_id: '67a1b2c3...', param_value: '\"store_001\"' },\n//   { param_id: '67a1b2c3...', param_value: '[\"2025-01-01\",\"2025-01-31\"]' },\n//   { param_id: '67a1b2c3...', param_value: '[\"Electronics\"]' },\n// ]\n\n// decode: EncodedParam[] → app key:value (use in paramChanged / executeSqlsTriggered)\nparamMapper.decode(payload.params);\n// → { store_id: 'store_001', date_range: [...], product_category: ['Electronics'] }\n```\n\n### Creating a mapper\n\n**`createParamMapper(mapping, meta?)`**\n\n| Argument | Type | Description |\n|----------|------|-------------|\n| `mapping` | `Record<string, string>` | Your app's key → Codatum `param_id` for each parameter. |\n| `meta` | `Record<key, ParamMeta>` (optional) | Same keys as `mapping`. Per-key options: `hidden`, `required`, `datatype`. |\n\n**`ParamMeta`** (optional, per key):\n\n| Property | Type | Description |\n|----------|------|-------------|\n| `datatype` | `ParamDatatype` | Enables validation and improves typing. See [Param datatypes](#param-datatypes) below. |\n| `required` | `boolean` | If `true`, `encode` and `decode` throw `MISSING_REQUIRED_PARAM` when the param is missing. |\n| `hidden` | `boolean` | If `true`, encoded params include `is_hidden: true` so the embed can hide them from the params form. |\n\n#### Param datatypes\n\nWhen `meta[key].datatype` is set, `encode` and `decode` validate values. Supported values:\n\n| `ParamDatatype` | JS/TS type | Notes |\n|-----------------|------------|--------|\n| `'STRING'` | `string` | — |\n| `'NUMBER'` | `number` | Rejects `NaN`. |\n| `'BOOLEAN'` | `boolean` | — |\n| `'DATE'` | `string` | Must be `YYYY-MM-DD`. |\n| `'STRING[]'` | `string[]` | Array of strings. |\n| `'[DATE, DATE]'` | `[string, string]` | Date range; both elements must be `YYYY-MM-DD`. |\n\n### Instance methods\n\n| Method | Description |\n|--------|-------------|\n| **`encode(values, options?)`** | App key:value → `EncodedParam[]`. JSON-stringifies values. Use `RESET_TO_DEFAULT` as a value to reset that param to the notebook's default.\n| **`decode(params, options?)`** | `EncodedParam[]` → app key:value. Ignores params not in mapping. |\n\n#### `encode` / `decode` options\n\nBoth methods accept an optional second argument:\n\n| Option | Type | Description |\n|--------|------|-------------|\n| `only` | `(keyof mapping)[]` | Limit to these keys. Useful when the host sends only a subset (e.g. server sends some params; client sends the rest via `encode` with `only`). |\n| `noValidate` | `boolean` | When `true`, skips required and datatype validation. |\n\n### Type-first usage\n\nWhen you define parameter definitions (e.g. with `datatype`) and want typed encode/decode, you can use the helper types.\n\n```ts\nimport { createParamMapper, RESET_TO_DEFAULT, type DefineDecodedParams, type EncodedParam } from '@codatum/embed';\n\nconst paramDefs = {\n  store_id: { datatype: 'STRING', required: true },\n  date_range: { datatype: '[DATE, DATE]' },\n  product_category: { datatype: 'STRING[]' },\n} as const;\n\ntype ParamValues = DefineDecodedParams<typeof paramDefs>;\n// → { store_id: string, date_range?: [string, string], product_category?: string[] }\n\nconst paramValues: ParamValues = {\n  store_id: 'store_001',\n  date_range: RESET_TO_DEFAULT,\n  product_category: ['Electronics']\n};\n\nconst paramMapper = createParamMapper({\n  store_id: '67a1b2c3d4e5f6a7b8c9d0e1',\n  date_range: '67a1b2c3d4e5f6a7b8c9d0e2',\n  product_category: '67a1b2c3d4e5f6a7b8c9d0e3',\n}, paramDefs);\n\n// encode only the date_range and product_category params for client-side params\nconst clientParams = paramMapper.encode(paramValues, { only: ['date_range', 'product_category'] })\n// → [\n//   { param_id: '67a1b2c3d4e5f6a7b8c9d0e2', param_value: '[\"2025-01-01\",\"2025-01-31\"]' },\n//   { param_id: '67a1b2c3d4e5f6a7b8c9d0e3', param_value: '[\"Electronics\"]' },\n// ]\n\nconst onParamChanged = (ev: { params: EncodedParam[] }) => {\n  const values: ParamValues = paramMapper.decode(ev.params);\n  console.log('Changed:', values);\n};\n```\n\n## Errors\n\nAll errors are thrown/rejected as `EmbedError` with a `code` property.\n\n| Code | Thrown by | Description |\n|------|----------|-------------|\n| `INVALID_OPTIONS` | `createEmbed` | Options are invalid |\n| `CONTAINER_NOT_FOUND` | `init` | Container element not found |\n| `LOADING_TIMEOUT` | `init` / `reload` | `CONTENT_READY` not received within `tokenOptions.loadingTimeout`; auto-refresh reports via `onRefreshError` |\n| `TOKEN_PROVIDER_FAILED` | `init` / `reload` | `tokenProvider` threw |\n| `MISSING_REQUIRED_PARAM` | `encode` / `decode` | Required param missing |\n| `INVALID_PARAM_VALUE` | `encode` / `decode` | Value failed validation |\n| `UNEXPECTED_ERROR` | `createEmbed` / `init` / `reload` | Unexpected error |\n\n### Error handling\n\n`init()` and `reload()` throw on failure — handle with try/catch. Auto-refresh errors are delivered via the `tokenOptions.onRefreshError` callback.\n```ts\nimport { createEmbed, EmbedError } from '@codatum/embed';\n\ntry {\n  const embed = createEmbed({\n    container: '#dashboard',\n    embedUrl: '...',\n    tokenProvider: async () => { /* ... */ },\n    tokenOptions: {\n      onRefreshError: (error) => {\n        // Token auto-refresh failed after all retries.\n        // e.g. redirect to login, show a banner, etc.\n        console.error('Refresh failed:', error);\n      },\n    },\n  });\n  await embed.init();\n\n  // reload() also throws on failure\n  await embed.reload();\n} catch (error) {\n  if (error instanceof EmbedError) {\n      // error.cause holds the original error thrown by tokenProvider (if applicable)\n    console.error(error.code, error.message);\n  }\n}\n```\n\n## Usage examples\n\nThe following patterns demonstrate common integration scenarios as outlined in the [Signed embed use cases](https://docs.codatum.com/sharing/signed-embed/use-case).\n\n### Example A: Params form in embed (server validates store, client sends filters)\n\nEmbed shows the notebook's parameter form. The server validates `store_id` and encodes it in the token; the client sends current `store_id` on each token request and encodes only `date_range` and `product_category` as client-side params so the form and host stay in sync.\n\n**Client**\n\n```ts\nimport { createEmbed, createParamMapper, RESET_TO_DEFAULT } from '@codatum/embed';\n\nconst paramMapper = createParamMapper({...}, {\n  store_id: { datatype: 'STRING' },  // server-side param\n  date_range: { datatype: '[DATE, DATE]' },  // client-side param\n  product_category: { datatype: 'STRING[]' },  // client-side param\n});\nlet paramValues = { store_id: undefined, date_range: RESET_TO_DEFAULT, product_category: [] };\n\nconst embed = createEmbed({\n  container: '#dashboard',\n  embedUrl: '...',\n  displayOptions: { expandParamsFormByDefault: true },\n  tokenProvider: async () => {\n    const res = await fetch('/api/codatum/token', {\n      method: 'POST',\n      body: JSON.stringify({ tokenUserId: userId, params: { store_id: paramValues.store_id } }),\n    });\n    const { token } = await res.json();\n    const params = paramMapper.encode(paramValues, { only: ['date_range', 'product_category'] });\n    return { token, params };\n  },\n});\nawait embed.init();\n\nembed.on('paramChanged', (ev) => { paramValues = paramMapper.decode(ev.params); });\nembed.on('executeSqlsTriggered', (ev) => { paramValues = paramMapper.decode(ev.params); });\n```\n\nRunnable: [React](https://github.com/codatum/codatum-embed-js/blob/main/examples/react/src/scenarios/Scenario1.tsx), [Vue](https://github.com/codatum/codatum-embed-js/blob/main/examples/vue/src/scenarios/Scenario1.vue)\n\n**Server** — Validate `store_id` against the tenant and encode it in the token:\n\n```ts\nimport { createParamMapper } from '@codatum/embed';\n\n// POST /token body: { tokenUserId, params?: { store_id } }\nconst paramMapper = createParamMapper({...}, {\n  tenant_id: { datatype: 'STRING', required: true },  // server-side param\n  store_id: { datatype: 'STRING', required: true },  // server-side param\n});\nconst tenantId = await getTenantIdByUserId(tokenUserId);\nconst storeIdsForTenant = await getStoreIdsByTenantId(tenantId);\nconst storeId = params?.store_id ?? storeIdsForTenant[0];\nif (!storeIdsForTenant.includes(storeId)) throw new Error('Invalid storeId');\nconst encoded = paramMapper.encode({ tenant_id: tenantId, store_id: storeId });\n// issue token with encoded params\n```\n\nRunnable: [Node.js](https://github.com/codatum/codatum-embed-js/blob/main/examples/server/src/scenarios/scenario1/handlers.ts)\n\n### Example B: Client-side params only (SaaS owns filters, hide params form)\n\nAll parameters except `tenant_id` are managed by the host; the embed's parameter form is hidden. The token carries only tenant context, so it can be cached and reused. When the user changes filters in the host UI, call `reload()` so the token provider runs again with updated values.\n\n**Client**\n\n```ts\nimport { createEmbed, createParamMapper } from '@codatum/embed';\n\nconst paramMapper = createParamMapper({...}, {\n  store_id: { datatype: 'STRING' },  // client-side param\n  date_range: { datatype: '[DATE, DATE]' },  // client-side param\n  product_category: { datatype: 'STRING[]' },  // client-side param\n});\nlet paramValues = { store_id: 'store_001', date_range: ['2025-01-01', '2025-01-31'], product_category: [] };\n\nconst embed = createEmbed({\n  container: '#dashboard',\n  embedUrl: '...',\n  displayOptions: { hideParamsForm: true },\n  tokenProvider: async () => {\n    const res = await fetch('/api/codatum/token', { method: 'POST', body: JSON.stringify({ tokenUserId: userId }) });\n    const { token } = await res.json();\n    const params = paramMapper.encode(paramValues);\n    return { token, params };\n  },\n});\nawait embed.init();\n\nembed.on('paramChanged', (ev) => { paramValues = paramMapper.decode(ev.params); });\nembed.on('executeSqlsTriggered', (ev) => { paramValues = paramMapper.decode(ev.params); });\n\n// When the user changes filters in the host UI, update paramValues and reload the embed\nasync function onDashboardFilterChange(newValues: ParamValues) {\n  paramValues = newValues;\n  await embed.reload();\n}\n```\n\nRunnable: [React](https://github.com/codatum/codatum-embed-js/blob/main/examples/react/src/scenarios/Scenario2.tsx), [Vue](https://github.com/codatum/codatum-embed-js/blob/main/examples/vue/src/scenarios/Scenario2.vue)\n\n**Server** — Token needs only tenant scope (no param in body):\n\n```ts\nimport { createParamMapper } from '@codatum/embed';\n\n// POST /token body: { tokenUserId }\nconst paramMapper = createParamMapper({...}, {\n  tenant_id: { datatype: 'STRING', required: true },  // server-side param\n});\nconst tenantId = await getTenantIdByUserId(tokenUserId);\nconst encoded = paramMapper.encode({ tenant_id: tenantId });\n// issue token with encoded params\n```\n\nRunnable: [Node.js](https://github.com/codatum/codatum-embed-js/blob/main/examples/server/src/scenarios/scenario2/handlers.ts)\n\n### Example C: Server-side store (token re-issue on store change)\n\n`store_id` is fixed in the token and validated server-side; changing the store requires a new token. The params form is visible for `date_range` and `product_category`. Keep latest param values from `paramChanged` and pass `store_id` to the server on each token request; when the user switches store, reload so a new token is issued for the new store.\n\n**Client**\n\n```ts\nimport { createEmbed, createParamMapper, RESET_TO_DEFAULT } from '@codatum/embed';\n\nconst paramMapper = createParamMapper({...}, {\n  store_id: { datatype: 'STRING' },  // server-side param\n  date_range: { datatype: '[DATE, DATE]' },  // client-side param\n  product_category: { datatype: 'STRING[]' },  // client-side param\n});\nlet paramValues = { store_id: undefined, date_range: RESET_TO_DEFAULT, product_category: ['Electronics'] };\n\nconst embed = createEmbed({\n  container: '#dashboard',\n  embedUrl: '...',\n  displayOptions: { expandParamsFormByDefault: true },\n  tokenProvider: async () => {\n    const res = await fetch('/api/codatum/token', {\n      method: 'POST',\n      body: JSON.stringify({ tokenUserId: userId, params: { store_id: paramValues.store_id } }),\n    });\n    const { token } = await res.json();\n    const params = paramMapper.encode(paramValues, { only: ['date_range', 'product_category'] });\n    return { token, params };\n  },\n});\nawait embed.init();\n\nembed.on('paramChanged', (ev) => { paramValues = paramMapper.decode(ev.params); });\nembed.on('executeSqlsTriggered', (ev) => { paramValues = paramMapper.decode(ev.params); });\n\nasync function onStoreSwitch(storeId: string) {\n  paramValues.store_id = storeId;\n  await embed.reload();\n}\n```\n\nRunnable: [React](https://github.com/codatum/codatum-embed-js/blob/main/examples/react/src/scenarios/Scenario3.tsx), [Vue](https://github.com/codatum/codatum-embed-js/blob/main/examples/vue/src/scenarios/Scenario3.vue)\n\n**Server** — Same as Example A: accept `params.store_id`, validate, encode `tenant_id` + `store_id` in the token.\n\nRunnable: [Node.js](https://github.com/codatum/codatum-embed-js/blob/main/examples/server/src/scenarios/scenario3/handlers.ts)\n\n## CDN\n\nA separate IIFE build exposes a single global `CodatumEmbed`. Load the script and use `CodatumEmbed.createEmbed` then `embed.init()`.\n\n```html\n<script src=\"https://unpkg.com/@codatum/embed/dist/index.global.min.js\"></script>\n<script>\n  (async function () {\n    const embed = CodatumEmbed.createEmbed({ container: '#dashboard', embedUrl: '...', tokenProvider: ... });\n    await embed.init();\n  })();\n</script>\n```\n\n## See also\n\n- **Versioning and changelog**: [Versioning](https://github.com/codatum/codatum-embed-js#versioning)\n- **Security and deployment**: [Security and deployment](https://github.com/codatum/codatum-embed-js#security-and-deployment)\n- **Supported environments**: [Supported environments](https://github.com/codatum/codatum-embed-js#supported-environments)\n","readmeFilename":"README.md"}