{"_id":"@multisetai/vps","_rev":"25-a3f3f355a49146280997135384bcc002","name":"@multisetai/vps","dist-tags":{"latest":"2.5.0"},"versions":{"1.1.0":{"name":"@multisetai/vps","version":"1.1.0","keywords":["multiset","webxr","three","ar","localization","vps","visual-positioning","augmented-reality"],"author":"","license":"UNLICENSED","_id":"@multisetai/vps@1.1.0","maintainers":[{"name":"nikhilsawlani","email":"support@multiset.ai"},{"name":"shub3dfe","email":"shubham@multiset.ai"}],"homepage":"https://github.com/MultiSet-AI/multiset-vps-webxr#readme","bugs":{"url":"https://github.com/MultiSet-AI/multiset-vps-webxr/issues"},"dist":{"shasum":"180d23a457105be5a403b34c2a8a8a91e25b398a","tarball":"https://registry.npmjs.org/@multisetai/vps/-/vps-1.1.0.tgz","fileCount":9,"integrity":"sha512-WdkJJiXl4gUjzBipgTVVkErwDV21W5dzLYCbjiPbrDL4Fc2860I9GLIN8Htf8wNWm39mDktMjDObiz0EF1xphw==","signatures":[{"sig":"MEQCIBbrACPq0vfNPlMOCjdpE3iBhR3uJLAOIhU2WTL3xFJ/AiBvvycOpNoTPqEq4Uh0EEK4ly3xThoDSmPdBYTG2Qo8+A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":70577},"main":"dist/index.js","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.js"},"./core":{"types":"./dist/core/index.d.ts","import":"./dist/core/index.js","require":"./dist/core/index.js"},"./webxr":{"types":"./dist/webxr/index.d.ts","import":"./dist/webxr/index.js","require":"./dist/webxr/index.js"}},"gitHead":"90ad344ca9f4b065b2798e0d4affe2816e70080a","scripts":{"build":"tsup"},"_npmUser":{"name":"shub3dfe","email":"shubham@multiset.ai"},"repository":{"url":"git+https://github.com/MultiSet-AI/multiset-vps-webxr.git","type":"git"},"_npmVersion":"10.9.2","description":"Multiset VPS WebXR SDK - Core client and WebXR controller.","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","dependencies":{"axios":"1.10.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.1.0","eslint":"^9.25.0","rimraf":"^6.0.1","typescript":"~5.8.3","@types/three":"^0.176.0","eslint-config-prettier":"^9.1.0","@typescript-eslint/parser":"^8.30.1","@typescript-eslint/eslint-plugin":"^8.30.1"},"peerDependencies":{"three":">=0.176.0"},"_npmOperationalInternal":{"tmp":"tmp/vps_1.1.0_1775073374569_0.246189017981995","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@multisetai/vps","version":"2.0.0","keywords":["multiset","webxr","three","ar","localization","vps","visual-positioning","augmented-reality"],"author":"","license":"UNLICENSED","_id":"@multisetai/vps@2.0.0","maintainers":[{"name":"nikhilsawlani","email":"support@multiset.ai"},{"name":"shub3dfe","email":"shubham@multiset.ai"}],"homepage":"https://github.com/MultiSet-AI/multiset-vps-webxr#readme","bugs":{"url":"https://github.com/MultiSet-AI/multiset-vps-webxr/issues"},"dist":{"shasum":"fb52325363037965590fe24532c812b8af15d3b9","tarball":"https://registry.npmjs.org/@multisetai/vps/-/vps-2.0.0.tgz","fileCount":9,"integrity":"sha512-5BoQ7C/myJVLmgQK0reo7wA6R6+Rn8LAXJYnxFm6zyJnEcAxcmghMRLyC4tsGVUF+BfBc+YsZk/AniEveD8Baw==","signatures":[{"sig":"MEUCIQDZqHD7cDOO7nzsNc1jZXFhkjG/QDuP4X8z2/v4ZO/mOgIgQaJaOSDz2NANAFzj/5DpONpqsWxcs3oOhwLWjKfUOI8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":86395},"main":"dist/index.js","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.js"},"./core":{"types":"./dist/core/index.d.ts","import":"./dist/core/index.js","require":"./dist/core/index.js"},"./three":{"types":"./dist/three/index.d.ts","import":"./dist/three/index.js","require":"./dist/three/index.js"}},"gitHead":"7089d4a0c1a605d5c244168401713a34945b9368","scripts":{"build":"tsup"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:48585bdb-8bbe-4d1a-8c4f-238ee3cd4457"}},"repository":{"url":"git+https://github.com/MultiSet-AI/multiset-vps-webxr.git","type":"git"},"_npmVersion":"11.11.0","description":"Multiset VPS WebXR SDK - Core client and WebXR controller.","directories":{},"sideEffects":false,"_nodeVersion":"24.14.1","dependencies":{"axios":"1.10.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.1.0","eslint":"^9.25.0","rimraf":"^6.0.1","typescript":"~5.8.3","@types/three":"^0.176.0","eslint-config-prettier":"^9.1.0","@typescript-eslint/parser":"^8.30.1","@typescript-eslint/eslint-plugin":"^8.30.1"},"peerDependencies":{"three":">=0.176.0"},"_npmOperationalInternal":{"tmp":"tmp/vps_2.0.0_1778529695441_0.9512922213195125","host":"s3://npm-registry-packages-npm-production"}},"2.1.0":{"name":"@multisetai/vps","version":"2.1.0","keywords":["multiset","webxr","three","ar","localization","vps","visual-positioning","augmented-reality"],"author":"","license":"UNLICENSED","_id":"@multisetai/vps@2.1.0","maintainers":[{"name":"nikhilsawlani","email":"support@multiset.ai"},{"name":"shub3dfe","email":"shubham@multiset.ai"}],"homepage":"https://github.com/MultiSet-AI/multiset-vps-webxr#readme","bugs":{"url":"https://github.com/MultiSet-AI/multiset-vps-webxr/issues"},"dist":{"shasum":"95dd0545a91bd58305f7950e7e44dee429870c75","tarball":"https://registry.npmjs.org/@multisetai/vps/-/vps-2.1.0.tgz","fileCount":9,"integrity":"sha512-WK7AFy7CtaywsaFjSzvwtDIlZ+egjf7JYQ1nCJBCWsV3EossbpNBC7LgdCk1cxCzAtpWSyQCoqDu/YgfDTGfig==","signatures":[{"sig":"MEYCIQDfxMY6TzeKPHLaUOVlr0mKFcingpQAFzt0ACZGZbcipQIhANcGP9HzqI1X2vbu6ArJlKSE4XsTH6bf/K8/jil8fDb9","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":86420},"main":"dist/index.js","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.js"},"./core":{"types":"./dist/core/index.d.ts","import":"./dist/core/index.js","require":"./dist/core/index.js"},"./three":{"types":"./dist/three/index.d.ts","import":"./dist/three/index.js","require":"./dist/three/index.js"}},"gitHead":"0e2b7fd344453455c0e6b751383d66fe1de33554","scripts":{"build":"tsup"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:48585bdb-8bbe-4d1a-8c4f-238ee3cd4457"}},"repository":{"url":"git+https://github.com/MultiSet-AI/multiset-vps-webxr.git","type":"git"},"_npmVersion":"11.11.0","description":"Multiset VPS WebXR SDK - Core client and WebXR controller.","directories":{},"sideEffects":false,"_nodeVersion":"24.14.1","dependencies":{"axios":"1.10.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.1.0","eslint":"^9.25.0","rimraf":"^6.0.1","typescript":"~5.8.3","@types/three":"^0.176.0","eslint-config-prettier":"^9.1.0","@typescript-eslint/parser":"^8.30.1","@typescript-eslint/eslint-plugin":"^8.30.1"},"peerDependencies":{"three":">=0.176.0"},"_npmOperationalInternal":{"tmp":"tmp/vps_2.1.0_1778531553173_0.6761553100186521","host":"s3://npm-registry-packages-npm-production"}},"2.1.1":{"name":"@multisetai/vps","version":"2.1.1","keywords":["multiset","webxr","three","ar","localization","vps","visual-positioning","augmented-reality"],"author":"","license":"UNLICENSED","_id":"@multisetai/vps@2.1.1","maintainers":[{"name":"nikhilsawlani","email":"support@multiset.ai"},{"name":"shub3dfe","email":"shubham@multiset.ai"}],"homepage":"https://github.com/MultiSet-AI/multiset-vps-webxr#readme","bugs":{"url":"https://github.com/MultiSet-AI/multiset-vps-webxr/issues"},"dist":{"shasum":"87e49b99ab17c4d835471becc8b425584cfafb01","tarball":"https://registry.npmjs.org/@multisetai/vps/-/vps-2.1.1.tgz","fileCount":9,"integrity":"sha512-9E74a2QIaA7v+JvC6NQffJfShKlWHpmFRRMHP0bsFG/XUpz5TNmx+rUtpB/FcZ8t9IsRCAX53dX0ij2sATD00g==","signatures":[{"sig":"MEUCIQCaI3Y/bjVkd6hm+2jY1bugIdo38clQNObHoaamDXOHlQIgIjNkGleRgvmCzFLZBDDkFFy2MK5Yz28RP9wUOmgeyag=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":86531},"main":"dist/index.js","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.js"},"./core":{"types":"./dist/core/index.d.ts","import":"./dist/core/index.js","require":"./dist/core/index.js"},"./three":{"types":"./dist/three/index.d.ts","import":"./dist/three/index.js","require":"./dist/three/index.js"}},"gitHead":"101da86fa36ee0cc5472519378e45e75f0d05160","scripts":{"build":"tsup"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:48585bdb-8bbe-4d1a-8c4f-238ee3cd4457"}},"repository":{"url":"git+https://github.com/MultiSet-AI/multiset-vps-webxr.git","type":"git"},"_npmVersion":"11.11.0","description":"Multiset VPS WebXR SDK - Core client and WebXR controller.","directories":{},"sideEffects":false,"_nodeVersion":"24.14.1","dependencies":{"axios":"1.10.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.1.0","eslint":"^9.25.0","rimraf":"^6.0.1","typescript":"~5.8.3","@types/three":"^0.176.0","eslint-config-prettier":"^9.1.0","@typescript-eslint/parser":"^8.30.1","@typescript-eslint/eslint-plugin":"^8.30.1"},"peerDependencies":{"three":">=0.176.0"},"_npmOperationalInternal":{"tmp":"tmp/vps_2.1.1_1778605535018_0.7967524028870299","host":"s3://npm-registry-packages-npm-production"}},"2.2.0":{"name":"@multisetai/vps","version":"2.2.0","keywords":["multiset","webxr","three","ar","localization","vps","visual-positioning","augmented-reality"],"author":"","license":"UNLICENSED","_id":"@multisetai/vps@2.2.0","maintainers":[{"name":"nikhilsawlani","email":"support@multiset.ai"},{"name":"shub3dfe","email":"shubham@multiset.ai"}],"homepage":"https://github.com/MultiSet-AI/multiset-vps-webxr#readme","bugs":{"url":"https://github.com/MultiSet-AI/multiset-vps-webxr/issues"},"dist":{"shasum":"160efb316ed7f565c651fbbf0fed6c1e1ea8905e","tarball":"https://registry.npmjs.org/@multisetai/vps/-/vps-2.2.0.tgz","fileCount":9,"integrity":"sha512-yEQgERyzhmlrMtT0v+4P3cWmb235SvGqArejYaOwtnxWA2cLmziFP+BGvf8oYYFBa7pnoOW63P6LRb9CcNjdlQ==","signatures":[{"sig":"MEUCIQCY5Y45skXxE65NtrY1JKNtPitYjIAO2F4kNm6hqXsg4wIgEBVe3eyDiLVLnzB7fn5ErlZFwA9O6DF7cqWRmXjjflk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":121455},"main":"dist/index.js","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.js"},"./core":{"types":"./dist/core/index.d.ts","import":"./dist/core/index.js","require":"./dist/core/index.js"},"./three":{"types":"./dist/three/index.d.ts","import":"./dist/three/index.js","require":"./dist/three/index.js"}},"gitHead":"92981dcfd906c90e9bdd126e9b2a9428997bac61","scripts":{"build":"tsup"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:48585bdb-8bbe-4d1a-8c4f-238ee3cd4457"}},"repository":{"url":"git+https://github.com/MultiSet-AI/multiset-vps-webxr.git","type":"git"},"_npmVersion":"11.13.0","description":"Multiset VPS WebXR SDK - Core client and WebXR controller.","directories":{},"sideEffects":false,"_nodeVersion":"24.16.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.1.0","eslint":"^9.25.0","rimraf":"^6.0.1","typescript":"~5.8.3","@types/three":"^0.176.0","eslint-config-prettier":"^9.1.0","@typescript-eslint/parser":"^8.30.1","@typescript-eslint/eslint-plugin":"^8.30.1"},"peerDependencies":{"three":">=0.176.0"},"_npmOperationalInternal":{"tmp":"tmp/vps_2.2.0_1780073519320_0.04979567011440378","host":"s3://npm-registry-packages-npm-production"}},"2.2.1":{"name":"@multisetai/vps","version":"2.2.1","keywords":["multiset","webxr","three","ar","localization","vps","visual-positioning","augmented-reality"],"author":"","license":"UNLICENSED","_id":"@multisetai/vps@2.2.1","maintainers":[{"name":"nikhilsawlani","email":"support@multiset.ai"},{"name":"shub3dfe","email":"shubham@multiset.ai"}],"homepage":"https://github.com/MultiSet-AI/multiset-vps-webxr#readme","bugs":{"url":"https://github.com/MultiSet-AI/multiset-vps-webxr/issues"},"dist":{"shasum":"978645f161cc78c0b21485f3f02f49484f369162","tarball":"https://registry.npmjs.org/@multisetai/vps/-/vps-2.2.1.tgz","fileCount":9,"integrity":"sha512-W+0nDRIAfKJPX+eu5G+jj/ddYake9wL/mQnUlxA0u9IzB9z9w7Z98hdA92nz8S+5Vwbhh/d7aIHdJW/SG80D3w==","signatures":[{"sig":"MEUCIDd9rc0JoWzxjVFXhnOQKJKd8dk4ALwcCVqBaCaQCzaSAiEAuu3FLxBSvFMnvg13tEb0vmjvnPPmkEqIO+o+oPaPbCs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":124640},"main":"dist/index.js","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.js"},"./core":{"types":"./dist/core/index.d.ts","import":"./dist/core/index.js","require":"./dist/core/index.js"},"./three":{"types":"./dist/three/index.d.ts","import":"./dist/three/index.js","require":"./dist/three/index.js"}},"gitHead":"278cb590824460e123bc750513b605b082ff1192","scripts":{"build":"tsup"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:48585bdb-8bbe-4d1a-8c4f-238ee3cd4457"}},"repository":{"url":"git+https://github.com/MultiSet-AI/multiset-vps-webxr.git","type":"git"},"_npmVersion":"11.13.0","description":"Multiset VPS WebXR SDK - Core client and WebXR controller.","directories":{},"sideEffects":false,"_nodeVersion":"24.16.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.1.0","eslint":"^9.25.0","rimraf":"^6.0.1","typescript":"~5.8.3","@types/three":"^0.176.0","eslint-config-prettier":"^9.1.0","@typescript-eslint/parser":"^8.30.1","@typescript-eslint/eslint-plugin":"^8.30.1"},"peerDependencies":{"three":">=0.176.0"},"_npmOperationalInternal":{"tmp":"tmp/vps_2.2.1_1780084327053_0.8497626558809575","host":"s3://npm-registry-packages-npm-production"}},"2.3.1":{"name":"@multisetai/vps","version":"2.3.1","keywords":["multiset","webxr","three","ar","localization","vps","visual-positioning","augmented-reality"],"author":"","license":"UNLICENSED","_id":"@multisetai/vps@2.3.1","maintainers":[{"name":"nikhilsawlani","email":"support@multiset.ai"},{"name":"shub3dfe","email":"shubham@multiset.ai"}],"homepage":"https://github.com/MultiSet-AI/multiset-vps-webxr#readme","bugs":{"url":"https://github.com/MultiSet-AI/multiset-vps-webxr/issues"},"dist":{"shasum":"beb34ca677a78a20aa36b88f04272af54271a15e","tarball":"https://registry.npmjs.org/@multisetai/vps/-/vps-2.3.1.tgz","fileCount":15,"integrity":"sha512-4CZ1uiAathzdMK1nexsi7ICjBKaeV/FyJ8WWr+Jx3+akUiQ/5H3lKFhQ82pH0yky54Lvkz3+5Ds3LnVO7uVdBQ==","signatures":[{"sig":"MEYCIQC6h56AMcWsr3XWdVkweEZqSfJsKKHr0W37/noPKw9HQAIhALXYYGsPZhOD5OvYvz+OH1HL/gSjEVUipeMW3NG7TU6c","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":218426},"main":"dist/index.js","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.js"},"./core":{"types":"./dist/core/index.d.ts","import":"./dist/core/index.js","require":"./dist/core/index.js"},"./three":{"types":"./dist/three/index.d.ts","import":"./dist/three/index.js","require":"./dist/three/index.js"},"./needle":{"types":"./dist/needle/index.d.ts","import":"./dist/needle/index.js","require":"./dist/needle/index.js"}},"gitHead":"7701085d470f62587016eb6c42b7166ae9f305ca","scripts":{"build":"tsup"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:48585bdb-8bbe-4d1a-8c4f-238ee3cd4457"}},"repository":{"url":"git+https://github.com/MultiSet-AI/multiset-vps-webxr.git","type":"git"},"_npmVersion":"11.13.0","description":"Multiset VPS WebXR SDK - Core client and WebXR controller.","directories":{},"sideEffects":false,"_nodeVersion":"24.17.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.1.0","three":"npm:@needle-tools/three@0.169.19","eslint":"^9.25.0","rimraf":"^6.0.1","typescript":"~5.8.3","@types/three":"0.169.0","@needle-tools/engine":"5.1.2","eslint-config-prettier":"^9.1.0","@typescript-eslint/parser":"^8.30.1","@typescript-eslint/eslint-plugin":"^8.30.1"},"peerDependencies":{"three":">=0.169.0","@needle-tools/engine":">=5.1.2"},"peerDependenciesMeta":{"three":{"optional":true},"@needle-tools/engine":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/vps_2.3.1_1782800486382_0.7051996407200842","host":"s3://npm-registry-packages-npm-production"}},"2.3.3":{"name":"@multisetai/vps","version":"2.3.3","keywords":["multiset","webxr","three","ar","localization","vps","visual-positioning","augmented-reality"],"author":"","license":"UNLICENSED","_id":"@multisetai/vps@2.3.3","maintainers":[{"name":"nikhilsawlani","email":"support@multiset.ai"},{"name":"shub3dfe","email":"shubham@multiset.ai"}],"homepage":"https://github.com/MultiSet-AI/multiset-vps-webxr#readme","bugs":{"url":"https://github.com/MultiSet-AI/multiset-vps-webxr/issues"},"dist":{"shasum":"47cc0b6ff0ad80751b067f6a5dcd4a97fcd800b6","tarball":"https://registry.npmjs.org/@multisetai/vps/-/vps-2.3.3.tgz","fileCount":16,"integrity":"sha512-NSq+xV5ZI1I7Woh2qBDlx5Qffe+8Q/bmx8mFugWSLB6XTSUsH21GhSHuGJJH9StX5M8LSKZqto9t2QV1dfEiQg==","signatures":[{"sig":"MEUCIC/rBqGqafyPcbS5N7mPKkspy5LIb93cmirnFcP7MOQtAiEA0v0wDB2r5m6pqcDN8wdNJNAjcN4BG9uvXZlK7gSXra0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":241514},"main":"dist/index.js","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.js"},"./core":{"types":"./dist/core/index.d.ts","import":"./dist/core/index.js","require":"./dist/core/index.js"},"./three":{"types":"./dist/three/index.d.ts","import":"./dist/three/index.js","require":"./dist/three/index.js"},"./needle":{"types":"./dist/needle/index.d.ts","import":"./dist/needle/index.js","require":"./dist/needle/index.js"}},"gitHead":"d9c5b917af4deb5dad464a268da4a0b603815222","scripts":{"build":"tsup"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:48585bdb-8bbe-4d1a-8c4f-238ee3cd4457"}},"repository":{"url":"git+https://github.com/MultiSet-AI/multiset-vps-webxr.git","type":"git"},"_npmVersion":"11.16.0","description":"Multiset VPS WebXR SDK - Core client and WebXR controller.","directories":{},"sideEffects":false,"_nodeVersion":"24.18.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.1.0","three":"npm:@needle-tools/three@0.169.19","eslint":"^9.25.0","rimraf":"^6.0.1","typescript":"~5.8.3","@types/three":"0.169.0","@needle-tools/engine":"5.1.9","eslint-config-prettier":"^9.1.0","@typescript-eslint/parser":"^8.30.1","@typescript-eslint/eslint-plugin":"^8.30.1"},"peerDependencies":{"three":">=0.169.0","@needle-tools/engine":">=5.1.9"},"peerDependenciesMeta":{"three":{"optional":true},"@needle-tools/engine":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/vps_2.3.3_1786020551316_0.6028612212776645","host":"s3://npm-registry-packages-npm-production"}},"2.4.0":{"name":"@multisetai/vps","version":"2.4.0","keywords":["multiset","webxr","three","ar","localization","vps","visual-positioning","augmented-reality"],"author":"","license":"UNLICENSED","_id":"@multisetai/vps@2.4.0","maintainers":[{"name":"nikhilsawlani","email":"support@multiset.ai"},{"name":"shub3dfe","email":"shubham@multiset.ai"}],"homepage":"https://github.com/MultiSet-AI/multiset-vps-webxr#readme","bugs":{"url":"https://github.com/MultiSet-AI/multiset-vps-webxr/issues"},"dist":{"shasum":"5373c2088bc6b1662920c303c28ff70a8cf787ed","tarball":"https://registry.npmjs.org/@multisetai/vps/-/vps-2.4.0.tgz","fileCount":20,"integrity":"sha512-/Tebzb2e304L9u0JBmPXCWkI9BjNJKZt5EFRZaEGeestGOBahH85Rda34nr8Y27/8Tmfi/vYtp2PLiS0AJEI+Q==","signatures":[{"sig":"MEUCIGE5o1oLX2f+VzW2klbiZNpUeX1ss5Bif8VpUhqeBbgTAiEA+koMEdwpW2wxUt+CgQ9FSVY83xMan2lRqV0NW4NMAVY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":319417},"main":"dist/index.js","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.js"},"./core":{"types":"./dist/core/index.d.ts","import":"./dist/core/index.js","require":"./dist/core/index.js"},"./three":{"types":"./dist/three/index.d.ts","import":"./dist/three/index.js","require":"./dist/three/index.js"},"./needle":{"types":"./dist/needle/index.d.ts","import":"./dist/needle/index.js","require":"./dist/needle/index.js"},"./navigation":{"types":"./dist/navigation/index.d.ts","import":"./dist/navigation/index.js","require":"./dist/navigation/index.js"}},"gitHead":"0fb8cf4a5a610d7accbed287845413f5da20b96e","scripts":{"build":"tsup"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:48585bdb-8bbe-4d1a-8c4f-238ee3cd4457"}},"repository":{"url":"git+https://github.com/MultiSet-AI/multiset-vps-webxr.git","type":"git"},"_npmVersion":"11.17.0","description":"Multiset VPS WebXR SDK - Core client and WebXR controller.","directories":{},"sideEffects":false,"_nodeVersion":"24.19.0","publishConfig":{"access":"public"},"typesVersions":{"*":{"core":["./dist/core/index.d.ts"],"three":["./dist/three/index.d.ts"],"needle":["./dist/needle/index.d.ts"],"navigation":["./dist/navigation/index.d.ts"]}},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.1.0","three":"npm:@needle-tools/three@0.169.19","eslint":"^9.25.0","rimraf":"^6.0.1","typescript":"~5.8.3","@types/three":"0.169.0","three-pathfinding":"^1.3.0","@needle-tools/engine":"5.1.9","eslint-config-prettier":"^9.1.0","@typescript-eslint/parser":"^8.30.1","@typescript-eslint/eslint-plugin":"^8.30.1"},"peerDependencies":{"three":">=0.169.0","three-pathfinding":">=1.3.0","@needle-tools/engine":">=5.1.9"},"peerDependenciesMeta":{"three":{"optional":true},"three-pathfinding":{"optional":true},"@needle-tools/engine":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/vps_2.4.0_1786705889003_0.44713927334322734","host":"s3://npm-registry-packages-npm-production"}},"2.4.1":{"name":"@multisetai/vps","version":"2.4.1","keywords":["multiset","webxr","three","ar","localization","vps","visual-positioning","augmented-reality"],"author":"","license":"UNLICENSED","_id":"@multisetai/vps@2.4.1","maintainers":[{"name":"nikhilsawlani","email":"support@multiset.ai"},{"name":"shub3dfe","email":"shubham@multiset.ai"}],"homepage":"https://github.com/MultiSet-AI/multiset-vps-webxr#readme","bugs":{"url":"https://github.com/MultiSet-AI/multiset-vps-webxr/issues"},"dist":{"shasum":"25453e98069f0da7346dc42b89d33b10b6114d73","tarball":"https://registry.npmjs.org/@multisetai/vps/-/vps-2.4.1.tgz","fileCount":20,"integrity":"sha512-itUSMq9wQd7TyAeNYKFyKKAvJWx3ME/lgU/sdd6IzxZSCtPsGvOqN+Un6JWt3e0zDdciqyNPQrLSy4o65Y8jIg==","signatures":[{"sig":"MEUCIHyX+z0uBmQ0KkSya/kPaSG36pT5Y7Ksa3ylxZvs7kTfAiEAryTsajHT/ujRKOyzn4vZnALC+S7t+e7otbyqwNutHpg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":319625},"main":"dist/index.js","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.js"},"./core":{"types":"./dist/core/index.d.ts","import":"./dist/core/index.js","require":"./dist/core/index.js"},"./three":{"types":"./dist/three/index.d.ts","import":"./dist/three/index.js","require":"./dist/three/index.js"},"./needle":{"types":"./dist/needle/index.d.ts","import":"./dist/needle/index.js","require":"./dist/needle/index.js"},"./navigation":{"types":"./dist/navigation/index.d.ts","import":"./dist/navigation/index.js","require":"./dist/navigation/index.js"}},"gitHead":"3248eba9ece9e290c60abb3e18facf4c81563503","scripts":{"build":"tsup"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:48585bdb-8bbe-4d1a-8c4f-238ee3cd4457"}},"repository":{"url":"git+https://github.com/MultiSet-AI/multiset-vps-webxr.git","type":"git"},"_npmVersion":"11.17.0","description":"Multiset VPS WebXR SDK - Core client and WebXR controller.","directories":{},"sideEffects":false,"_nodeVersion":"24.19.0","publishConfig":{"access":"public"},"typesVersions":{"*":{"core":["./dist/core/index.d.ts"],"three":["./dist/three/index.d.ts"],"needle":["./dist/needle/index.d.ts"],"navigation":["./dist/navigation/index.d.ts"]}},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.1.0","three":"npm:@needle-tools/three@0.169.19","eslint":"^9.25.0","rimraf":"^6.0.1","typescript":"~5.8.3","@types/three":"0.169.0","three-pathfinding":"^1.3.0","@needle-tools/engine":"5.1.9","eslint-config-prettier":"^9.1.0","@typescript-eslint/parser":"^8.30.1","@typescript-eslint/eslint-plugin":"^8.30.1"},"peerDependencies":{"three":">=0.169.0","three-pathfinding":">=1.3.0","@needle-tools/engine":">=5.1.9"},"peerDependenciesMeta":{"three":{"optional":true},"three-pathfinding":{"optional":true},"@needle-tools/engine":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/vps_2.4.1_1787127177584_0.4989844743087357","host":"s3://npm-registry-packages-npm-production"}},"2.5.0":{"_id":"@multisetai/vps@2.5.0","bugs":{"url":"https://github.com/MultiSet-AI/multiset-vps-webxr/issues"},"dist":{"shasum":"df3ec42c2f51e2c72f75cba936d45efaae9a0c24","tarball":"https://registry.npmjs.org/@multisetai/vps/-/vps-2.5.0.tgz","fileCount":20,"integrity":"sha512-Bno5+BD6zoSatU3hy2PBDbbAzoiQTZAFJp6JW6qdkl0OUrGBN4DyAtQjYCNJ5gqANPPap3eJQ8Vw4Q31pIZgsg==","signatures":[{"sig":"MEUCIQCF3u+BFr3U3EYyE2V8PpEtdATpkT78VqCWzZJ9Eh5XiAIgNupcO+9FaHoJfNEwrCgjzuEu92UCI5d9aLAfunvA48I=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDLuAQoVrL44eo8XuVVAdnVBCDF4dHxe+3STl3YBSneZQIgP2kV9rJ8qiaUeUNuKrpcSBrih127AXX7yLIv0NLJvfo="}],"unpackedSize":411258},"main":"dist/index.js","name":"@multisetai/vps","type":"module","types":"dist/index.d.ts","author":"","module":"dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js"},"./core":{"types":"./dist/core/index.d.ts","import":"./dist/core/index.js","require":"./dist/core/index.js"},"./three":{"types":"./dist/three/index.d.ts","import":"./dist/three/index.js","require":"./dist/three/index.js"},"./needle":{"types":"./dist/needle/index.d.ts","import":"./dist/needle/index.js","require":"./dist/needle/index.js"},"./navigation":{"types":"./dist/navigation/index.d.ts","import":"./dist/navigation/index.js","require":"./dist/navigation/index.js"}},"gitHead":"b1033b0982b4520a012873a24ea4287448e925c8","license":"UNLICENSED","scripts":{"build":"tsup"},"version":"2.5.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"48585bdb-8bbe-4d1a-8c4f-238ee3cd4457"}},"homepage":"https://github.com/MultiSet-AI/multiset-vps-webxr#readme","keywords":["multiset","webxr","three","ar","localization","vps","visual-positioning","augmented-reality"],"repository":{"url":"git+https://github.com/MultiSet-AI/multiset-vps-webxr.git","type":"git"},"_npmVersion":"11.19.1","description":"Multiset VPS WebXR SDK - Core client and WebXR controller.","directories":{},"maintainers":[{"name":"nikhilsawlani","email":"support@multiset.ai"},{"name":"shub3dfe","email":"shubham@multiset.ai"}],"sideEffects":false,"_nodeVersion":"24.22.2","publishConfig":{"access":"public"},"typesVersions":{"*":{"core":["./dist/core/index.d.ts"],"three":["./dist/three/index.d.ts"],"needle":["./dist/needle/index.d.ts"],"navigation":["./dist/navigation/index.d.ts"]}},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.1.0","three":"npm:@needle-tools/three@0.169.19","eslint":"^9.25.0","rimraf":"^6.0.1","typescript":"~5.8.3","@types/three":"0.169.0","three-pathfinding":"^1.3.0","@needle-tools/engine":"5.1.9","eslint-config-prettier":"^9.1.0","@typescript-eslint/parser":"^8.30.1","@typescript-eslint/eslint-plugin":"^8.30.1"},"peerDependencies":{"three":">=0.169.0","three-pathfinding":">=1.3.0","@needle-tools/engine":">=5.1.9"},"peerDependenciesMeta":{"three":{"optional":true},"three-pathfinding":{"optional":true},"@needle-tools/engine":{"optional":true}},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/vps_2.5.0_1794333576682_0.10412552117207718"}}},"time":{"created":"2025-12-09T17:54:58.891Z","modified":"2026-11-10T17:59:37.016Z","1.0.4":"2025-12-09T17:54:59.126Z","1.0.5":"2026-01-04T16:27:48.245Z","1.0.6":"2026-01-09T10:42:49.036Z","1.0.7-beta.0":"2026-02-27T19:40:20.611Z","1.0.7-beta.1":"2026-03-03T20:25:46.462Z","1.0.7-beta.2":"2026-03-04T19:06:13.632Z","1.0.7-beta.3":"2026-03-10T19:38:05.741Z","1.0.7-beta.4":"2026-03-10T20:02:42.288Z","1.0.7-beta.5":"2026-03-11T18:42:23.131Z","1.0.7-beta.6":"2026-03-11T18:55:39.203Z","1.1.0":"2026-04-01T19:56:14.724Z","2.0.0":"2026-05-11T20:01:35.634Z","2.1.0":"2026-05-11T20:32:33.317Z","2.1.1":"2026-05-12T17:05:35.228Z","2.2.0":"2026-05-29T16:51:59.454Z","2.2.1":"2026-05-29T19:52:07.196Z","2.3.1":"2026-06-30T06:21:26.576Z","2.3.3":"2026-08-06T12:49:11.439Z","2.4.0":"2026-08-14T11:11:29.165Z","2.4.1":"2026-08-19T08:12:57.785Z","2.5.0":"2026-11-10T17:59:36.846Z"},"bugs":{"url":"https://github.com/MultiSet-AI/multiset-vps-webxr/issues"},"license":"UNLICENSED","homepage":"https://github.com/MultiSet-AI/multiset-vps-webxr#readme","keywords":["multiset","webxr","three","ar","localization","vps","visual-positioning","augmented-reality"],"repository":{"url":"git+https://github.com/MultiSet-AI/multiset-vps-webxr.git","type":"git"},"description":"Multiset VPS WebXR SDK - Core client and WebXR controller.","maintainers":[{"name":"nikhilsawlani","email":"support@multiset.ai"},{"name":"shub3dfe","email":"shubham@multiset.ai"}],"readme":"# MultiSet VPS WebXR\n\nTypeScript SDK for integrating MultiSet's Visual Positioning System (VPS) into WebXR applications. Provides 6-DOF localization by matching camera frames against cloud-hosted maps, and object tracking by matching camera frames against registered 3D objects.\n\n## Contents\n\n- [Architecture](#architecture)\n- [Installation](#installation)\n- [Requirements](#requirements)\n- [CORS Configuration](#cors-configuration)\n- [Authentication](#authentication) — keep the client secret out of production bundles\n- [Quick Start](#quick-start)\n  - [VPS — Three.js](#vps-localization--threejs)\n  - [VPS — Vanilla / WebGL2](#vps-localization--without-threejs-webgl2--vanilla)\n  - [Object Tracking — Three.js](#object-tracking--threejs)\n  - [Needle Engine](#needle-engine)\n    - [Unity Inspector Workflow](#unity-inspector-workflow)\n    - [MapSpace — anchoring a whole subtree](#mapspace--anchoring-a-whole-subtree-unity)\n    - [MapAnchor — zero-code object placement](#mapanchor--zero-code-object-placement-unity)\n- [Navigation](#navigation) — AR wayfinding ([full guide](https://docs.multiset.ai/multiset/webxr-sdk/navigation))\n- [Canvas Visibility During AR](#canvas-visibility-during-ar)\n- [API Reference](#api-reference)\n  - [MultisetClient](#multisetclient)\n  - [XRSessionManager](#xrsessionmanager)\n  - [ThreeAdapter](#threeadapter)\n  - [NeedleAdapter](#needleadapter)\n  - [IVpsAdapter](#ivpsadapter) — the contract both adapters share\n  - [MapSpace](#mapspace)\n  - [MapAnchor](#mapanchor)\n  - [Navigation](#navigation-1)\n  - [NavMeshPathfinder](#navmeshpathfinder)\n  - [buildPathRibbon](#buildpathribboncorners-options)\n  - [MultisetVPS](#multisetvps)\n- [Placing Content at Map Coordinates](#placing-content-at-map-coordinates)\n- [Occlusion](#occlusion)\n- [Improving Localization](#improving-localization) — deep search, multi-frame, search depth, pose hints, first-fix retries\n- [Map Versions](#map-versions) — show a re-scanned map's newest mesh\n- [Geo Coordinates](#geo-coordinates)\n- [Styling the AR Button](#styling-the-ar-button)\n- [Custom Start / Stop Button](#custom-start--stop-button)\n- [Type Definitions](#type-definitions)\n- [Troubleshooting](#troubleshooting)\n  - [AR button doesn't appear](#ar-button-doesnt-appear)\n  - [MapAnchor not appearing after localization](#mapanchor-not-appearing-after-localization-needle)\n  - [MapSpace content missing or misplaced](#mapspace-content-not-appearing-or-in-the-wrong-place-needle)\n  - [Component start() never called](#component-start-never-called-needle)\n\n---\n\n## Architecture\n\nThe SDK is split into independent entry points so you only install what you need:\n\n| Entry point | Contents | Peer deps |\n|---|---|---|\n| `@multisetai/vps/core` | `MultisetClient` + `XRSessionManager` | None |\n| `@multisetai/vps/three` | `ThreeAdapter` | `three >=0.169.0` |\n| `@multisetai/vps/needle` | `NeedleAdapter` | `@needle-tools/engine` (brings its own `three`) |\n\n`XRSessionManager` owns the full vanilla WebXR session lifecycle — frame loop, camera capture, localization, tracking-loss recovery — with zero Three.js dependency. `ThreeAdapter` and `NeedleAdapter` wire it to a renderer and scene.\n\n## Installation\n\n```bash\n# Core only (no Three.js)\nnpm install @multisetai/vps\n\n# With Three.js adapter\nnpm install @multisetai/vps three\n\n# With Needle Engine — no separate `three` install needed.\n# Needle Engine ships its own three.js fork as a dependency.\nnpm install @multisetai/vps\n```\n\n## Requirements\n\n- **HTTPS** — WebXR requires a secure context (`https://` or `http://localhost`).\n- **Android + ARCore** — Chrome or Edge on an ARCore-capable Android device (Android 8+, Chrome 81+).\n- **Three.js ≥ 0.169.0** — only required when using `@multisetai/vps/three`. Compatible through the latest release (r184+).\n- **Needle Engine ≥ 5.0.0** — only required when using `@multisetai/vps/needle`. Needle ships its own `three` fork — do **not** install `three` separately.\n\n> **iOS is not supported.** This SDK requires the `camera-access` WebXR feature. Safari on iOS does not implement it.\n\n## CORS Configuration\n\nThe SDK makes direct browser-to-API requests, so your domain must be whitelisted in the MultiSet dashboard.\n\n1. Open the [MultiSet Dashboard](https://docs.multiset.ai/basics/credentials/configuring-allowed-domains-cors)\n2. Go to **Credentials → Settings → Domains**\n3. Click **Add +** and enter your origin (e.g. `https://localhost:5173` for dev, `https://your-app.com` for prod)\n\nWithout this, the browser will block every API request with a CORS error.\n\nLocal development origins are not allowed automatically. Add each one you use, with its protocol and port, for example `http://localhost:5173`. An HTTPS dev server (`https://localhost:5173`) and your computer's network address for testing on a phone (`https://192.168.1.20:5173`) are separate origins and need their own entries.\n\n---\n\n## Authentication\n\nWith `clientId` and `clientSecret` in your config, both ship inside your web bundle, where anyone can read the secret. For production, move the secret to your server: your server gets MultiSet access tokens, your app fetches them from your own API, and the SDK sends them on every MultiSet request. This is the same model as the MultiSet iOS SDK's token provider.\n\n### How it works\n\n```\nYour app ──── your sign-in ───► Your API ──── client ID + secret ───► MultiSet  POST /v1/m2m/token\nYour app ◄────── token ──────── Your API ◄──── {token, expiresOn} ────────────┘\n\nMultiSet SDK ──── Authorization: Bearer <token> ───► MultiSet API   (every request)\n```\n\nPick exactly one way to give the client its tokens:\n\n| Config | Secret in the browser? | Renewed automatically? | Use for |\n|---|---|---|---|\n| `clientId` + `clientSecret` | **Yes** | Yes | Prototyping and `localhost` only |\n| `getAccessToken` | No | Yes | Production. The token provider: a function that returns a token, however you fetch it |\n| `tokenUrl` | No | Yes | Production. A ready-made provider that `GET`s your endpoint |\n| `accessToken` | No | No, `onTokenExpired` fires | You already hold a token from elsewhere |\n\n### 1. Server: hand out tokens\n\nYour server requests a token from MultiSet with your client ID and secret:\n\n```bash\ncurl -X POST https://api.multiset.ai/v1/m2m/token -u \"$MULTISET_CLIENT_ID:$MULTISET_CLIENT_SECRET\"\n# {\"token\": \"<JWT>\", \"expiresOn\": \"2026-11-03T11:36:01.356Z\"}\n```\n\nTokens currently last 30 minutes. Expose an endpoint on **your own server** that hands one to your signed-in users. MultiSet does not host this endpoint: in the examples on this page, replace `YOUR_BACKEND_URL` with your server's address. A minimal example with Express:\n\n```typescript\n// MULTISET_CLIENT_ID / MULTISET_CLIENT_SECRET live only on the server.\n// requireLogin is your own sign-in middleware.\n// Your app reaches this route at https://YOUR_BACKEND_URL/multiset-token.\napp.get('/multiset-token', requireLogin, async (_req, res) => {\n  const basic = Buffer.from(`${process.env.MULTISET_CLIENT_ID}:${process.env.MULTISET_CLIENT_SECRET}`).toString('base64');\n  const r = await fetch('https://api.multiset.ai/v1/m2m/token', {\n    method: 'POST',\n    headers: { Authorization: `Basic ${basic}`, 'Content-Type': 'application/json' },\n    body: '{}',\n  });\n  res.set('Cache-Control', 'no-store').status(r.status).json(await r.json()); // { token, expiresOn }\n});\n```\n\nRules for the endpoint:\n\n- **Keep the secret on the server**, in an environment variable or a secret manager. Never send it to the browser.\n- **Require your own sign-in, over HTTPS**, and rate-limit it. Whoever holds a token can call the MultiSet API as your account until it expires.\n- **Use a credential with only the Query scope**, so issued tokens can localize but never modify maps.\n- **On another origin than your app, send CORS headers.** When the token endpoint is not on the app's own origin (another host or port), it must answer with `Access-Control-Allow-Origin` set to your app's origin and `Access-Control-Allow-Headers: Authorization`, and reply to the `OPTIONS` preflight. Otherwise the browser blocks the response and `authorize()` fails with only `Failed to fetch`.\n- **Use the app's environment.** Request tokens from the same host as the client's `endpoints` (`https://api.multiset.ai` unless you changed them).\n- **The CORS allowlist still applies** to the browser's MultiSet calls. See [CORS Configuration](#cors-configuration).\n\n### 2. App: give the SDK a token provider\n\nRemove `clientId` and `clientSecret` from the app and pass `getAccessToken` (or `tokenUrl`) instead:\n\n```typescript\nconst client = new MultisetClient({\n  getAccessToken: async () => {\n    const res = await fetch('https://YOUR_BACKEND_URL/multiset-token', {\n      headers: { Authorization: `Bearer ${myAppSession.accessToken}` },\n      signal: AbortSignal.timeout(20_000),\n    });\n    if (!res.ok) throw new Error(`Token endpoint returned ${res.status}`);\n    return res.json(); // { token, expiresOn }, or just the token string\n  },\n  mapType: 'map',\n  code: 'YOUR_MAP_CODE',\n});\n\nawait client.authorize(); // once; later tokens are fetched automatically\n```\n\n`myAppSession.accessToken` stands for however your app proves its user to your API. When the token endpoint is on the same site as your app and can rely on its cookies instead, `tokenUrl: 'https://YOUR_BACKEND_URL/multiset-token'` does the same in one line: it is fetched with `GET` and `cache: 'no-store'`.\n\nThe SDK calls your provider:\n\n| When | Why |\n|---|---|\n| `authorize()` | The first token |\n| The first request within a minute of the token's expiry | Renewal before it runs out |\n| A request MultiSet refused with HTTP 401 | The request is then retried once with the new token |\n\n- **Return the token, or `{ token, expiresOn }`.** Without `expiresOn` the SDK reads the expiry from the token's own `exp` claim, so returning just the string is fine.\n- Requests made at the same time share one call to your provider.\n- The SDK does not time out your call, so give your request a timeout (`AbortSignal.timeout` above).\n\n**A token you already hold.** With `accessToken: '<JWT>'` the SDK uses that token as is and never renews it. When it expires, `onTokenExpired` fires once; pass a new one to `client.setAccessToken(token, expiresOn?)`.\n\n### 3. Handle failures\n\n- **At startup:** if the provider throws, returns nothing, or the endpoint answers with an error, `authorize()` rejects with that error. Catch it, show your sign-in or retry UI, and call `authorize()` again.\n- **Later:** a failed renewal fails only the request that needed the new token; it reaches `onLocalizationFailure` / `onError` like any other failed request. The next request asks your provider again.\n- **Invalid credentials** on the server are reported by MultiSet as `HTTP 404: Invalid client id or client secret`.\n\n### Checklist\n\n- [ ] `clientId` and `clientSecret` are gone from the app, its configuration and its repository\n- [ ] The token endpoint requires your sign-in, uses HTTPS and is rate-limited\n- [ ] The provider's request has a timeout\n- [ ] A failed `authorize()` can be retried from your UI\n\nIn Needle, fill in the **Token Url** field on the `MultisetVPS` component instead of `clientId` / `clientSecret`.\n\n---\n\n## Quick Start\n\n### VPS Localization — Three.js\n\n```typescript\nimport * as THREE from 'three';\nimport { MultisetClient, XRSessionManager } from '@multisetai/vps/core';\nimport { ThreeAdapter } from '@multisetai/vps/three';\n\n// Check support before showing any AR UI\nconst supported = await ThreeAdapter.isSupported();\nif (!supported) {\n  console.warn('WebXR immersive-ar is not supported on this device.');\n}\n\nconst client = new MultisetClient({\n  clientId: 'CLIENT_ID',\n  clientSecret: 'CLIENT_SECRET',\n  code: 'MAP_OR_MAPSET_CODE',\n  mapType: 'map',\n});\n\nawait client.authorize();\n\nconst renderer = new THREE.WebGLRenderer({ antialias: true });\ndocument.body.appendChild(renderer.domElement);\n\nconst scene = new THREE.Scene();\nconst camera = new THREE.PerspectiveCamera(70, window.innerWidth / window.innerHeight, 0.01, 1000);\n\nconst session = new XRSessionManager(renderer.getContext() as WebGL2RenderingContext, {\n  client,\n  overlayRoot: document.body,\n  autoLocalize: true,\n  confidenceCheck: true,\n  confidenceThreshold: 0.5,\n  onSessionStart: () => {\n    // Hide the canvas during AR — the XR compositor owns the display.\n    renderer.domElement.style.display = 'none';\n  },\n  onSessionEnd: () => {\n    renderer.domElement.style.display = 'block';\n  },\n  onLocalizationResult: (result) => console.log('Localized:', result.localizeData.position),\n  onLocalizationFailure: (reason) => console.warn('Failed:', reason),\n  onError: (err) => console.error(err),\n});\n\nconst adapter = new ThreeAdapter({ session, renderer, scene, camera, showMesh: true });\nadapter.initialize(); // mounts the built-in START AR / STOP AR button\n\n// Add your 3D content\nscene.add(new THREE.Mesh(\n  new THREE.BoxGeometry(0.1, 0.1, 0.1),\n  new THREE.MeshBasicMaterial({ color: 0xff0077 })\n));\n```\n\n### VPS Localization — Without Three.js (WebGL2 / Vanilla)\n\nIn this mode the SDK manages the session lifecycle, camera capture, and localization. You are responsible for all rendering: each XR frame, draw your scene into `event.baseLayer.framebuffer` using the provided `gl` context. This approach works with any WebGL2-based renderer — Babylon.js, raw WebGL, or your own engine.\n\n```typescript\nimport { MultisetClient, XRSessionManager } from '@multisetai/vps/core';\n\nconst supported = await XRSessionManager.isSupported();\nif (!supported) {\n  console.warn('WebXR immersive-ar is not supported on this device.');\n}\n\nconst client = new MultisetClient({ clientId: '...', clientSecret: '...', code: '...', mapType: 'map' });\nawait client.authorize();\n\n// A WebGL2 context is required — WebXR renders into a GL framebuffer, not a 2D canvas.\nconst gl = document.querySelector('canvas')!.getContext('webgl2')!;\n\nconst session = new XRSessionManager(gl, {\n  client,\n  overlayRoot: document.body,\n  autoLocalize: true,\n  onLocalizationResult: (result) => console.log('Localized:', result.localizeData.position),\n  onError: (err) => console.error(err),\n});\n\n// Wire your render loop — called every XR frame with the current pose and framebuffer.\nsession.setXRFrameHandler((event) => {\n  // Bind event.baseLayer.framebuffer and render your scene using event.view for camera matrices.\n});\n\ndocument.body.appendChild(session.createButton());\n```\n\n### Object Tracking — Three.js\n\nObject tracking detects and poses registered 3D objects by matching a captured camera frame against the MultiSet cloud.\n\n```typescript\nimport * as THREE from 'three';\nimport { MultisetClient, XRSessionManager } from '@multisetai/vps/core';\nimport { ThreeAdapter } from '@multisetai/vps/three';\n\nconst client = new MultisetClient({\n  clientId: 'CLIENT_ID',\n  clientSecret: 'CLIENT_SECRET',\n  mapType: 'object-tracking',\n  code: ['YOUR_OBJECT_CODE'],\n});\n\nawait client.authorize();\n\nconst renderer = new THREE.WebGLRenderer({ antialias: true });\ndocument.body.appendChild(renderer.domElement);\nconst scene = new THREE.Scene();\nconst camera = new THREE.PerspectiveCamera(70, window.innerWidth / window.innerHeight, 0.01, 1000);\n\nconst session = new XRSessionManager(renderer.getContext() as WebGL2RenderingContext, {\n  client,\n  overlayRoot: document.body,\n  autoTracking: true,          // detect once on session start\n  confidenceCheck: true,\n  confidenceThreshold: 0.5,\n  onSessionStart: () => { renderer.domElement.style.display = 'none'; },\n  onSessionEnd:   () => { renderer.domElement.style.display = 'block'; },\n  onObjectTrackingSuccess: (result) => {\n    console.log('Detected', result.objectCodes, 'at', result.position);\n  },\n  onObjectTrackingFailure: (reason) => console.warn('Tracking failed:', reason),\n  onError: (err) => console.error(err),\n});\n\nconst adapter = new ThreeAdapter({\n  session,\n  renderer,\n  scene,\n  camera,\n  showObjectMeshes: true,       // load and display the 3D outline mesh\n  onObjectMeshLoaded: (code) => console.log('Mesh loaded for', code),\n});\nadapter.initialize();\n\n// Trigger tracking manually from a button\ntrackButton.addEventListener('click', () => {\n  void adapter.trackObjects();\n});\n```\n\n### Needle Engine\n\n`NeedleAdapter` is a Needle Engine `Behaviour` component. Add it to a GameObject via `addNewComponent()` from your own component's `start()`. The built-in START AR / STOP AR button mounts automatically — no `initialize()` call needed.\n\n> **Important:** Do **not** add a Needle `WebXR` component to the same scene. `NeedleAdapter` must own the WebXR session directly because it bypasses Three.js's built-in XR manager (`renderer.xr`). This is required to work around a Chrome/WebXR regression where enabling `camera-access` corrupts Three.js's internal texture state. Adding a Needle `WebXR` component would start a second session and conflict with this setup. Delete the `WebXR` component from the scene hierarchy before adding `MultisetVPS`.\n\n#### Unity Inspector workflow\n\n`MultisetVPS`, `MapSpace`, and `MapAnchor` are ready-made components. Copy a few template files into your project, fill in credentials in the Inspector — no code required.\n\n> **Why template files?** Needle Engine's Unity codegen scans only your local `src/scripts/` folder to generate C# stubs — it skips `node_modules`. Copying the templates into your project gives Unity the component definitions it needs, while all SDK utilities (`NeedleAdapter`, `MultisetClient`, etc.) are still imported from the package.\n>\n> A consequence worth remembering: these components are **not package exports**. In code, import them relatively (`./MapSpace.js`), never from `@multisetai/vps/needle`. They are also yours to edit — Needle will not overwrite them.\n\n1. **Install** in your Needle web project:\n   ```bash\n   npm install @multisetai/vps\n   ```\n\n2. **Copy the TypeScript templates** into your Needle project's scripts folder (the folder Needle scans for components — `web/src/scripts/` by default, but use whatever path your project uses):\n\n   ```bash\n   cp node_modules/@multisetai/vps/templates/MultisetVPS.ts <your-web-folder>/src/scripts/\n   cp node_modules/@multisetai/vps/templates/MapSpace.ts    <your-web-folder>/src/scripts/\n   cp node_modules/@multisetai/vps/templates/MapAnchor.ts   <your-web-folder>/src/scripts/\n   cp node_modules/@multisetai/vps/templates/MapType.ts     <your-web-folder>/src/scripts/\n   ```\n\n   > `MapType.ts` must be present alongside `MultisetVPS.ts` — Needle's component compiler resolves the enum from this file to generate the **Map Type** dropdown. Without it the component will not appear in the Inspector.\n\n   Needle Engine automatically picks up everything in your scripts folder and generates the matching C# stubs in Unity.\n\n3. **Copy the C# enum** into your Unity project's `Assets/` folder (one-time setup — this file is never overwritten by Needle). Run this from inside your web folder:\n\n   ```bash\n   cp node_modules/@multisetai/vps/templates/MapType.cs ../Assets/\n   ```\n\n   This gives you a **Map Type** dropdown in the Inspector (`SingleMap / MapSet / ObjectTracking`). Without it, Needle generates the field but Unity can't compile the enum reference.\n\n4. **In Unity**, add a `MultisetVPS` component to any GameObject and fill in `clientId`, `clientSecret`, and `mapCode` in the Inspector. For production, fill in `tokenUrl` instead of the credentials — see [Authentication](#authentication).\n\n5. **Place your content.** Two options, and `MapSpace` is the recommended default:\n\n   - **`MapSpace`** — add it to a single empty GameObject at the scene root, then nest everything you want anchored underneath. Each child's normal Unity Transform position *is* its map coordinate, so you can paste values straight from the developer portal's Map Viewer and lay the scene out visually in the editor. See [MapSpace — anchoring a whole subtree](#mapspace--anchoring-a-whole-subtree-unity).\n   - **`MapAnchor`** — add it to an individual GameObject and type its coordinate into the `Offset` field. Best for one-off objects and runtime-spawned content. See [MapAnchor — zero-code object placement](#mapanchor--zero-code-object-placement-unity).\n\n   `MultisetVPS` discovers all `MapSpace` and `MapAnchor` instances automatically at startup — no manual wiring needed.\n\n6. **Export to web** — the START AR / STOP AR and CAPTURE FRAME buttons appear automatically.\n\n### Where map coordinates come from\n\nOpen your map in the **Map Viewer** (or **MapSet Viewer**) in the [developer portal](https://developer.multiset.ai), pick the point you want to anchor to, and copy the coordinates. These are **Unity left-handed** values, which is exactly what both components expect by default — paste them in unchanged.\n\nFor runtime-spawned objects (loaded from an API, instantiated mid-session), call `adapter.registerAnchor(anchor)` — see [MapAnchor — zero-code object placement](#mapanchor--zero-code-object-placement-unity) below.\n\n#### Code-based setup (without Unity Inspector)\n\n```typescript\nimport { Behaviour, serializable, addNewComponent } from '@needle-tools/engine';\nimport { MultisetClient } from '@multisetai/vps/core';\nimport { NeedleAdapter } from '@multisetai/vps/needle';\nimport * as THREE from 'three';\n\nexport class MyARComponent extends Behaviour {\n  async start() {\n    const client = new MultisetClient({\n      clientId: 'CLIENT_ID',\n      clientSecret: 'CLIENT_SECRET',\n      code: 'MAP_CODE',\n      mapType: 'map',\n    });\n\n    const adapter = new NeedleAdapter({\n      client,\n      showMesh: true,\n      sessionOptions: {\n        autoLocalize: true,\n        onSessionStart: () => console.log('AR started'),\n        onSessionEnd:   () => console.log('AR ended'),\n        onLocalizationFailure: (reason) => console.warn('Failed:', reason),\n        onError: (err) => console.error(err),\n      },\n      onLocalizationSuccess: (result, worldFromMap) => {\n        // Place content anchored to the scanned map\n        const marker = new THREE.Mesh(\n          new THREE.SphereGeometry(0.05),\n          new THREE.MeshBasicMaterial({ color: 0x00ff88 })\n        );\n        marker.position.applyMatrix4(worldFromMap);\n        this.context.scene.add(marker);\n      },\n    });\n\n    // addNewComponent triggers awake() — button mounts automatically\n    addNewComponent(this.gameObject, adapter);\n    await client.authorize();\n  }\n}\n```\n\n#### MapSpace — anchoring a whole subtree (Unity)\n\n`MapSpace` marks one GameObject as the **map origin**. On every successful localization it is moved so that its origin coincides with the scanned map's origin, and every descendant follows automatically.\n\nThis is the recommended way to place content in Unity, because a child's local Transform position *is* its map coordinate:\n\n```\nSampleScene\n├── MultisetVPS          ← credentials\n└── Map Space            ← MapSpace, transform at identity\n    ├── Office Entry     ← local position = portal coordinate\n    ├── Coffee Shack     ← local position = portal coordinate\n    └── Lift             ← local position = portal coordinate\n```\n\n**Setup**\n\n1. Create an empty GameObject at the scene root. Leave its transform at identity — Position `(0,0,0)`, Rotation `(0,0,0)`, Scale `(1,1,1)`.\n2. Add the `MapSpace` component.\n3. Nest the objects you want anchored underneath it.\n4. Set each child's normal Unity Transform position to its coordinate from the portal's Map Viewer.\n\n| Inspector field | Type | Default | Description |\n|---|---|---|---|\n| **Hide Until Localized** | `bool` | `true` | Hide anchored content until the first successful localization. Re-hides when the AR session ends. |\n\n**Why this over `MapAnchor` per object**\n\n- The Unity editor layout *is* the AR layout — arrange POIs visually instead of typing coordinates you cannot verify until you deploy.\n- Import the scanned map mesh as a child and place content against real geometry.\n- Relative layout is preserved exactly. Everything moves as one rigid body, so POIs can never drift apart.\n- One transform write per localization regardless of POI count.\n- No per-object handedness flag to get wrong.\n\n> **Note** — Unity authored transforms are converted to Three.js by Needle's exporter, so no handedness setting is involved. This is why `MapSpace` has no `isRightHanded` field while `MapAnchor` does.\n\n> **Important** — `hideUntilLocalized` makes the root invisible, and Needle treats an invisible GameObject as inactive. That applies to every **descendant**, so none of their `start()` methods run until the first localization. Keep always-running logic (session listeners, UI, network polling) on a separate GameObject **outside** this hierarchy.\n\n**Do not nest a `MapAnchor` inside a `MapSpace`.** `MapAnchor` writes a world position into a local transform, so inside an already-positioned root the offset is applied twice. `MultisetVPS` logs a warning if it detects this. Use one or the other for a given object.\n\n**Runtime-added children** do not go through the Unity exporter, so route their coordinates through `MapSpace.toLocal()`:\n\n```typescript\nimport { MapSpace } from './MapSpace.js';\nimport * as THREE from 'three';\n\nconst poi = instantiate(myPoiPrefab);\nmapSpace.gameObject.add(poi);\npoi.position.copy(MapSpace.toLocal(new THREE.Vector3(1.5, 0, -2.0)));  // Unity LHS in\n```\n\nAlternatively use `MapAnchor` with `registerAnchor()` and leave the object unparented — it accepts Unity values directly.\n\n---\n\n#### MapAnchor — zero-code object placement (Unity)\n\n`MapAnchor` is a Needle Engine component that anchors any GameObject to the VPS map origin after a successful localization. Add it to the object you want to place in AR from the Unity Inspector — no code required.\n\nUse it for individual objects, runtime-spawned content, and anything that must not inherit the map's rotation. For laying out several POIs in a scene, prefer [`MapSpace`](#mapspace--anchoring-a-whole-subtree-unity).\n\n| Inspector field | Type | Description |\n|---|---|---|\n| **Offset** | `Vector3` | Position offset from the map origin in metres. Enter Unity Inspector values directly — X is negated automatically unless **Is Right Handed** is enabled. |\n| **Match Orientation** | `bool` | Align the object's rotation to the map's orientation. |\n| **Rotation Offset** | `Vector3` (degrees) | Additional rotation applied on top of the map orientation. Only used when **Match Orientation** is enabled. Enter Unity Inspector values — Y and Z are negated automatically unless **Is Right Handed** is enabled. |\n| **Hide Until Localized** | `bool` | Hide the object until the first successful localization. Re-hides it when the AR session ends. |\n| **Is Right Handed** | `bool` | Off by default. When off, **Offset** and **Rotation Offset** are treated as Unity (left-handed) values and converted automatically. Enable only if you are entering Three.js (right-handed) values directly. |\n\n`MultisetVPS` (or your own component calling `addNewComponent`) automatically discovers all `MapAnchor` instances in the scene at startup and wires them to the adapter. You do not call any method manually.\n\n> **Important:** When `hideUntilLocalized` is `true`, Needle sets `visible = false` on the GameObject in `awake()`. An invisible GameObject is inactive in Needle — every component on it, not just `MapAnchor`, will have its `start()` skipped. Keep `MapAnchor` on the object you want placed in AR. Put any logic components (session listeners, custom UI) on a **separate, always-visible GameObject**.\n\nFor objects spawned **at runtime** (e.g. from API data or a prefab instantiated mid-session), register them explicitly so they receive localization events and are placed immediately if localization has already succeeded:\n\n```typescript\n// MapAnchor is a template file you copied into your own project — import it\n// relatively. It is NOT exported from the package.\nimport { MapAnchor } from './MapAnchor.js';\n\n// Spawn a new object at runtime and anchor it to the map\nconst obj = instantiate(myPrefab);\nconst anchor = addNewComponent(obj, new MapAnchor());\nanchor.hideUntilLocalized = true;\nanchor.offset.set(0.5, 0, -1.0);\n\n// Connect it — places immediately if localization already succeeded\nthis.adapter.registerAnchor(anchor);\n```\n\n**Using `useDefaultButton: false`** (custom button):\n\n```typescript\nconst adapter = new NeedleAdapter({\n  client,\n  useDefaultButton: false,\n  sessionOptions: { autoLocalize: true },\n});\n\naddNewComponent(this.gameObject, adapter);\nawait client.authorize();\n\nmyButton.addEventListener('click', () => {\n  if (adapter.isActive()) {\n    adapter.stopSession();\n  } else {\n    void adapter.startSession();\n  }\n});\n```\n\n---\n\n## Navigation\n\nAR indoor wayfinding on top of localization: pick a destination, follow an arrowed path along the\nfloor, arrive. Ships as a separate entry point, so an app that only localizes pays nothing for it.\n\n```bash\nnpm install @multisetai/vps three-pathfinding\n```\n\n`three-pathfinding` is an **optional** peer dependency, loaded on demand — install it only if you\nuse `NavMeshPathfinder`.\n\n**The package has the essentials to build a navigation app; it is not a navigation app.** You get\nthe state machine, pathfinding, and `buildPathRibbon` (corners → ribbon triangles). UI, shaders,\nmaterials, labels and icons are design decisions and live in the samples, where you own them.\n\n```ts\nimport { Navigation, NavMeshPathfinder, buildPathRibbon } from '@multisetai/vps/navigation';\n\nconst pathfinder = await NavMeshPathfinder.fromObject3D(navMesh, { space: mapSpace.object });\nconst navigation = await Navigation.create({ adapter, mapSpace, pathfinder, pois });\n\nnavigation.on('pathUpdated', ({ corners }) => {\n  mesh.geometry = buildPathRibbon(corners);   // your Mesh, your material\n});\nnavigation.setDestination('kitchen');\n```\n\nWorks with `ThreeAdapter` and `NeedleAdapter` alike — `Navigation` talks to\n[`IVpsAdapter`](#mapspace) and never imports either. It requires a [`MapSpace`](#mapspace), which\ndefines the coordinate frame every route is computed in; that is what makes relocalization free.\n\nFor a complete app — arrow shader, POI labels, destination panel, scene setup — start from the\n**[Needle navigation sample](https://github.com/MultiSet-AI/multiset-vps-navigation-needle-sample)**: a Unity project plus web folder, already wired. Clone it, add\nyour credentials and map code, and press play. A three.js sample is planned.\n\n→ **[Full navigation guide](https://docs.multiset.ai/multiset/webxr-sdk/navigation)** — setup, API, tuning, and troubleshooting.\n\n---\n\n## Canvas Visibility During AR\n\n> **Important** — the SDK renders the Three.js scene into the **XR framebuffer**, not the canvas element. During an active AR session the canvas element is not updated; it retains whatever was last drawn by the preview loop. If the canvas is visible during AR (e.g. as part of the WebXR DOM overlay) it will appear as a frozen image on top of the AR scene.\n\nAlways hide the canvas when the session starts and restore it when it ends:\n\n```typescript\nonSessionStart: () => { renderer.domElement.style.display = 'none'; },\nonSessionEnd:   () => { renderer.domElement.style.display = 'block'; },\n```\n\n---\n\n## API Reference\n\n### `MultisetClient`\n\nPure HTTP client for auth, localization, and object tracking. No WebXR or rendering concerns.\n\n```typescript\nnew MultisetClient(config: IMultisetClientConfig)\n```\n\n#### `IMultisetClientConfig`\n\n**VPS mode (`mapType: 'map'` or `mapType: 'map-set'`)**\n\n| Parameter | Type | Description |\n|---|---|---|\n| *auth* | | Exactly one of the auth options below |\n| `mapType` | `'map' \\| 'map-set'` | Whether `code` is a single map or a map set |\n| `code` | `string` | Map or map-set code |\n| `endpoints?` | `Partial<IMultisetSdkEndpoints>` | Override default API endpoints |\n| `isRightHanded?` | `boolean` | Handedness sent to the API. Default `true` |\n| `convertToGeoCoordinates?` | `boolean` | Add a WGS-84 `GeoPose` to the response. See [Geo Coordinates](#geo-coordinates) |\n| `hintPosition?` | `string` | Local-space position hint `\"x,y,z\"` |\n| `hintRadius?` | `number \\| string` | Search radius in metres (5–100, server default 25). Requires `hintPosition` or `passGeoPose` |\n| `hintFloorHeight?` | `[number, number]` | Vertical band `[yMin, yMax]` in map-local metres, e.g. one floor. Same values in Unity and WebXR coordinates (only X differs). |\n| `hintMapCodes?` | `string[]` | Narrow candidates by map code. Only valid when `mapType: 'map-set'` |\n| `queryMode?` | `'vps-1' \\| 'vps-2'` | Localization engine. `vps-1` (server default) answers in about 1 s; `vps-2` is a deep search with up to 15% higher recall at about 2 s. See [Improving Localization](#improving-localization). |\n| `depth?` | `number` | How far the search reaches inside the map, an integer 1–5 (server default 1). Raise only on large maps that return no pose; wider searches take longer. |\n| `passGeoPose?` | `boolean` | Send a `geoHint` from the Geolocation API with each request |\n| `use2DFiltering?` | `boolean` | Skip altitude in geo filtering. Only valid when `passGeoPose: true` |\n\n**Object tracking mode (`mapType: 'object-tracking'`)**\n\n| Parameter | Type | Description |\n|---|---|---|\n| *auth* | | Exactly one of the auth options below |\n| `mapType` | `'object-tracking'` | Enables object tracking mode. No map code required. |\n| `code` | `string[]` | Object codes to detect and track |\n| `isRightHanded?` | `boolean` | Handedness sent to the API. Default `true` |\n| `endpoints?` | `Partial<IMultisetSdkEndpoints>` | Override default API endpoints |\n\n**Auth options (exactly one)** — see [Authentication](#authentication)\n\n| Parameter | Type | Description |\n|---|---|---|\n| `clientId` + `clientSecret` | `string` | Exchanged for tokens in the browser. Prototyping only — the secret is visible in your bundle. |\n| `tokenUrl` | `string` | Your backend endpoint returning `{ token, expiresOn }`. Fetched with `GET`. |\n| `getAccessToken` | `() => Promise<IAccessToken \\| string>` | Called whenever a new token is needed. |\n| `accessToken` | `string` | A token you already have. Not refreshed by the SDK. |\n| `onTokenExpired?` | `() => void` | Fires once when an `accessToken` token has expired. Respond with `setAccessToken()`. |\n\n#### Methods\n\n| Method | Returns | Description |\n|---|---|---|\n| `authorize()` | `Promise<string>` | Get and cache an access token. Call once before any other method; later tokens are fetched automatically before expiry. |\n| `setAccessToken(token, expiresOn?)` | `void` | Replace the current token, e.g. from `onTokenExpired`. `expiresOn` defaults to the token's `exp` claim. |\n| `setCode(code, mapType?)` | `void` | Switch the map or MapSet for later localizations. Clears `hintMapCodes`. Call `localizeFrame()` afterwards; a previously loaded map mesh is replaced on the next localization. Not available in object-tracking mode. |\n| `setObjectCodes(codes)` | `void` | Replace the object codes for later tracking requests (object-tracking mode only). |\n| `setHints(hints)` | `void` | Update `hintPosition`, `hintRadius`, `hintFloorHeight` and `hintMapCodes` for later queries. Only the keys you pass change; pass `undefined` to clear one. See [`ILocalizationHints`](#ilocalizationhints). |\n| `setQueryOptions(options)` | `void` | Update `queryMode` and `depth` for later queries. Only the keys you pass change; pass `undefined` to return one to the server default. See [`ILocalizationQueryOptions`](#ilocalizationqueryoptions). |\n| `localizeWithFrame(frame, intrinsics, options?)` | `Promise<ILocalizeAndMapDetails \\| null>` | Submit a captured frame for VPS localization. `options` can override `queryMode` and `hintPosition` for this query only, and set `fetchMapDetails`. Rejected requests throw a `MultisetHttpError` with the HTTP `status`. |\n| `trackObject(frame, intrinsics)` | `Promise<IObjectTrackingResponse \\| null>` | Submit a captured frame for object detection. Uses `code` from the client config. Returns `null` when no object is detected. |\n| `downloadObjectMesh(objectCode)` | `Promise<string \\| null>` | Fetch a signed download URL for the 3D mesh of an object. |\n| `localizeWithFrames(frames, intrinsics, options?)` | `Promise<ILocalizeAndMapDetails \\| null>` | Multi-frame localization of 4–6 frames in one query. Give each frame a `trackingPose` (or none). The pose returned is that of the winning frame, `localizeData.imageId`. See [`IMultiFrameCapture`](#imultiframecapture). |\n| `fetchMapDetails(mapCode)` | `Promise<IGetMapsDetailsResponse \\| null>` | Fetch map metadata by code (result is cached). |\n| `fetchMapVersion(versionCode)` | `Promise<IMapVersionDetails \\| null>` | Fetch a Map Version: its scans, which are active, and their relative poses (cached). |\n| `fetchActiveMapVersion(mapDetails)` | `Promise<{ mapDetails, relativePose } \\| null>` | For a versioned map, the active scan's details and its relative pose to the base map. `null` when the map is not versioned or the base scan is active. |\n| `downloadFile(key)` | `Promise<string>` | Resolve a storage key to a signed download URL. Low-level — `downloadObjectMesh` and `fetchMapDetails` use it internally. |\n| `token` | `string \\| null` | *Getter.* The cached access token, or `null` before `authorize()`. Useful when debugging auth failures. |\n| `mapType` | `'map' \\| 'map-set' \\| 'object-tracking'` | *Getter.* The configured mode. |\n| `code` | `string \\| string[]` | *Getter.* The current map/MapSet code, or a copy of the object codes. |\n| `objectCodes` | `string[]` | *Getter.* The configured object codes. Empty unless `mapType: 'object-tracking'`. |\n| `queryOptions` | `ILocalizationQueryOptions` | *Getter.* The configured `queryMode` and `depth`. |\n| `isRightHanded` | `boolean` | *Getter.* Whether poses are returned right-handed (default `true`). |\n\n> The `set…()` methods update the config object you passed to the constructor in place, so it always reflects what the next request will send.\n\n---\n\n### `XRSessionManager`\n\nOwns the WebXR session lifecycle — frame loop, camera capture, localization, object tracking, and tracking-loss recovery. Zero Three.js dependency.\n\n```typescript\nimport { XRSessionManager } from '@multisetai/vps/core';\n\nnew XRSessionManager(gl: WebGL2RenderingContext, options: IXRSessionOptions)\n```\n\n#### `IXRSessionOptions`\n\n| Parameter | Type | Description |\n|---|---|---|\n| `client` | `MultisetClient` | Required. |\n| `overlayRoot?` | `HTMLElement` | Root element for the WebXR DOM overlay. |\n| `autoLocalize?` | `boolean` | Run one localization automatically when the session starts. |\n| `relocalization?` | `boolean` | Re-localize whenever tracking is lost and then recovered, including after the AR session was hidden (app switched away) or its reference space was reset. |\n| `confidenceCheck?` | `boolean` | Only accept results with `confidence >= confidenceThreshold`. Applies to both VPS and object tracking. |\n| `confidenceThreshold?` | `number` | Minimum confidence (0.2–0.8). Default `0.5`. |\n| `queryModeFallback?` | `boolean` | When a `vps-1` query finds no pose, or one below `confidenceThreshold` while `confidenceCheck` is on, query the same frame again with `vps-2`. No effect when the client's `queryMode` is `vps-2`. Default `false`. |\n| `useLastPoseAsHint?` | `boolean` | After a fix, send the device's current map position as `hintPosition` with each later query (within `hintRadius`, server default 25 m). Dropped on a tracking break, a return from the background, a map change or session end. Default `false`. |\n| `firstLocalizationUntilSuccess?` | `boolean` | Retry a failed first localization of each session silently, up to 5 times, then report it once. Default `false`. See [Improving Localization](#improving-localization). |\n| `localizationMode?` | `'single-frame' \\| 'multi-frame'` | `multi-frame` captures several frames and localizes them in one query, each sent with its tracker pose. More robust, slower. Default `'single-frame'`. |\n| `multiFrameCount?` | `number` | Frames per multi-frame query, clamped to 4–6. Default `4`. |\n| `multiFrameIntervalMs?` | `number` | Milliseconds between multi-frame captures, clamped to 400–800. Default `500`. |\n| `poseTimeoutMs?` | `number` | Max ms to wait for a valid viewer pose before failing. Default `10000`. |\n| `localizationTrackingTimeoutMs?` | `number` | **Deprecated** — use `poseTimeoutMs`. Will be removed in v3. |\n| `backgroundLocalization?` | `boolean` | Periodically send localization/tracking requests in the background while the session is active. |\n| `bgLocalizationInterval?` | `number` | Interval in seconds between background attempts. Clamped to 10–180 s. Default `30` for VPS modes, `10` for object tracking. |\n| `autoTracking?` | `boolean` | Call `trackObjects()` once automatically when the session starts. Requires `mapType: 'object-tracking'` on the client. |\n| `restartTracking?` | `boolean` | Re-attempt tracking whenever XR tracking is lost and then recovered. |\n| `trackingCaptureDelayMs?` | `number` | Milliseconds to wait before capturing a frame when `trackObjects()` is called. Useful for camera stabilisation. Default `0`. |\n| `referenceSpaceType?` | `XRReferenceSpaceType` | XR reference space type. Default `'local'`. Use `'local-floor'` for floor-relative tracking if the device supports it. |\n| `framebufferScaleFactor?` | `number` | XR framebuffer scale relative to native resolution. Values `< 1` reduce GPU load; values `> 1` supersample. |\n| `onSessionStart?` | `() => void` | Called when the AR session starts. |\n| `onSessionEnd?` | `() => void` | Called when the AR session ends. |\n| `onLocalizationInit?` | `() => void` | Called at the start of a VPS localization run. |\n| `onLocalizationResult?` | `(result: ILocalizeAndMapDetails) => void` | Called when VPS localization succeeds (and passes the confidence check, if enabled). |\n| `onLocalizationSuccess?` | `(result: ILocalizeAndMapDetails) => void` | **Deprecated** — use `onLocalizationResult`. If using `ThreeAdapter`, use its `onLocalizationSuccess` which also provides `worldFromMap`. Will be removed in v3. |\n| `onLocalizationFailure?` | `(reason?: string) => void` | Called when VPS localization fails or falls below the confidence threshold. |\n| `onFrameCaptured?` | `(frame: IFrameCaptureEvent) => void` | Called when a camera frame is captured for localization. |\n| `onCameraIntrinsics?` | `(intrinsics: ICameraIntrinsicsEvent) => void` | Called with camera intrinsic parameters for the captured frame. |\n| `onPoseResult?` | `(pose: IPoseResultEvent) => void` | Called with the raw pose result from the VPS backend. |\n| `onObjectTrackingInit?` | `() => void` | Called at the start of an object tracking run. |\n| `onObjectTrackingRequested?` | `(frame: IFrameCaptureEvent, intrinsics: ICameraIntrinsicsEvent) => void` | Called just before the tracking request is sent, with the captured frame and intrinsics. |\n| `onObjectTrackingSuccess?` | `(result: IObjectTrackingResponse) => void` | Called when object tracking succeeds and passes the confidence check (if enabled). |\n| `onObjectTrackingFailure?` | `(reason?: string) => void` | Called when object tracking fails or falls below the confidence threshold. |\n| `onError?` | `(error: unknown) => void` | Called when any error occurs. |\n| `onContextLost?` | `() => void` | Called when the WebGL context is lost. The active session is ended automatically. |\n| `onContextRestored?` | `() => void` | Called when the WebGL context is restored. The user may restart the session. |\n\n#### Static methods\n\n| Method | Returns | Description |\n|---|---|---|\n| `XRSessionManager.isSupported()` | `Promise<boolean>` | Returns `true` if the browser supports `immersive-ar` WebXR sessions. Use this to conditionally show AR UI before creating any objects. |\n\n#### Methods\n\n| Method | Returns | Description |\n|---|---|---|\n| `createButton()` | `HTMLButtonElement` | Create the built-in styled AR button. Shows **START AR** / **STOP AR** and toggles the session on click. |\n| `startSession()` | `Promise<void>` | Start an AR session programmatically. **Must be called from within a user gesture handler** (click/tap). |\n| `stopSession()` | `void` | Stop the active AR session. No-op if no session is running. |\n| `localizeFrame()` | `Promise<ILocalizeAndMapDetails \\| null>` | Capture and localize one frame against the configured map. Requires an active session. |\n| `trackObjects()` | `Promise<IObjectTrackingResponse \\| null>` | Capture one frame and run object detection. Requires an active session and `mapType: 'object-tracking'` on the client. |\n| `isActive()` | `boolean` | Whether an XR session is currently running. |\n| `isLocalizing` | `boolean` | Whether a localization or tracking run is currently in progress. |\n| `getClient()` | `MultisetClient` | Access the underlying `MultisetClient`. |\n| `getBaseLayer()` | `XRWebGLLayer \\| null` | The session's base layer, or `null` outside a session. Only needed if you render yourself — the adapters use it to size their XR framebuffer. |\n| `getXRSession()` | `XRSession \\| null` | The live WebXR session, or `null` when none is running. Mainly useful for `domOverlayState`: `dom-overlay` is only an *optional* feature of the session request, so without it HTML mounted over the session still renders but never receives taps — and nothing else will tell you why. |\n| `getOverlayRoot()` | `HTMLElement \\| undefined` | The element passed as `overlayRoot`. Mount in-session UI here so it receives taps while AR is presenting. |\n| `setBackgroundLocalization(enabled, intervalSeconds?)` | `void` | Turn background localization (tracking, in object-tracking mode) on or off mid-session. A new interval (10–180 s) restarts the timer. |\n| `setRelocalization(enabled)` | `void` | Re-localize whenever tracking is lost and recovered. |\n| `setRestartTracking(enabled)` | `void` | Re-attempt object tracking whenever tracking is lost and recovered. |\n| `setConfidenceCheck(enabled, threshold?)` | `void` | Accept only results at or above `threshold` (0.2–0.8). The threshold is unchanged when omitted. |\n| `setQueryModeFallback(enabled)` | `void` | Turn the `vps-2` retry of missed `vps-1` queries on or off. |\n| `setUseLastPoseAsHint(enabled)` | `void` | Turn the automatic pose hint on or off. |\n| `setLocalizationMode(mode)` | `void` | Switch between `'single-frame'` and `'multi-frame'` for later localizations. |\n| `dispose()` | `void` | End the session, clear background timers, remove context loss listeners, and release all resources. |\n\n#### Adapter hooks\n\nUsed internally by `ThreeAdapter`. Only call these when building a custom renderer adapter.\n\n| Method | Description |\n|---|---|\n| `setXRFrameHandler(fn)` | Called every XR frame with pose, view, viewport, and framebuffer info. |\n| `setAdapterResultHandler(fn)` | Called after a successful VPS localization with the result and tracker-space matrix. |\n| `setAdapterObjectTrackingHandler(fn)` | Called after a successful object tracking result with the result and tracker-space matrix. |\n| `setAdapterSessionHandlers(onStart, onEnd)` | Called on session start/end, before user callbacks. |\n\n---\n\n### `ThreeAdapter`\n\nWires `XRSessionManager` to a Three.js renderer. Handles XR framebuffer binding, camera matrix sync, preview loop, resize, and optional map mesh / gizmo / object mesh display.\n\n```typescript\nimport { ThreeAdapter } from '@multisetai/vps/three';\n\nnew ThreeAdapter(options: IThreeAdapterOptions)\n```\n\n#### `IThreeAdapterOptions`\n\n| Parameter | Type | Description |\n|---|---|---|\n| `session` | `XRSessionManager` | Required. |\n| `renderer` | `THREE.WebGLRenderer` | Required. |\n| `scene` | `THREE.Scene` | Required. |\n| `camera` | `THREE.PerspectiveCamera` | Required. |\n| `showMesh?` | `boolean` | Show the VPS map mesh after localization. Default `false`. |\n| `occlusion?` | `boolean` | Load the map mesh as an invisible occluder after localization, so virtual content behind real-world geometry is hidden. Takes precedence over `showMesh`. Default `false`. See [Occlusion](#occlusion). |\n| `useActiveMapVersion?` | `boolean` | For a map in a Map Version, show the active (newest) scan's mesh, placed in the base map's frame, instead of the base scan's. Default `false`. See [Map Versions](#map-versions). |\n| `showGizmo?` | `boolean` | Show a transform gizmo after localization. Default `true`. |\n| `showObjectMeshes?` | `boolean` | Load and display a 3D outline mesh for each detected object. Default `false`. |\n| `useDefaultButton?` | `boolean` | Mount the built-in START AR / STOP AR button. Default `true`. Set to `false` to drive the session via `startSession()` / `stopSession()`. |\n| `buttonContainer?` | `HTMLElement` | Where to append the built-in button. Defaults to `overlayRoot` or `document.body`. |\n| `onButtonCreated?` | `(button: HTMLButtonElement) => void` | Called after the built-in button is created. |\n| `onXRFrame?` | `(event: IXRFrameEvent) => void` | Called every XR frame after camera matrices are synced, before the scene is rendered. Use this to update scene objects each frame. |\n| `onLocalizationSuccess?` | `(result: ILocalizeAndMapDetails, worldFromMap: THREE.Matrix4) => void` | Called immediately after a successful VPS localization. `worldFromMap` transforms map-space coordinates to Three.js world space — use it to place content at known map coordinates. |\n| `onObjectMeshLoaded?` | `(objectCode: string) => void` | Called when a detected object's 3D mesh has been loaded and placed in the scene. Only fires when `showObjectMeshes: true`. |\n\n#### Static methods\n\n| Method | Returns | Description |\n|---|---|---|\n| `ThreeAdapter.isSupported()` | `Promise<boolean>` | Returns `true` if the browser supports `immersive-ar` WebXR sessions. |\n\n#### Methods\n\n| Method | Returns | Description |\n|---|---|---|\n| `initialize(buttonContainer?)` | `HTMLButtonElement \\| null` | Start the preview render loop, attach resize handler, and mount the built-in button. Returns `null` when `useDefaultButton: false`. |\n| `isActive()` | `boolean` | Whether an XR session is currently running. |\n| `isLocalizing` | `boolean` | Whether a localization or tracking run is currently in progress. |\n| `startSession()` | `Promise<void>` | Start an AR session. **Must be called from within a user gesture handler.** |\n| `stopSession()` | `void` | Stop the active AR session. No-op if no session is running. |\n| `localizeFrame()` | `Promise<ILocalizeAndMapDetails \\| null>` | Capture and localize one frame. |\n| `trackObjects()` | `Promise<IObjectTrackingResponse \\| null>` | Capture one frame and run object detection. Requires `mapType: 'object-tracking'` on the client. |\n| `clearObjectMeshes()` | `void` | Remove all object meshes from the scene that were placed by `showObjectMeshes`. |\n| `setOcclusion(enabled)` | `void` | Turn map-mesh occlusion on or off at runtime. Swaps the material on the loaded mesh, or fetches the mesh for the last localization if none is loaded. Takes precedence over `setShowMesh()`. |\n| `setShowMesh(enabled)` | `void` | Show or hide the map mesh overlay at runtime, without re-downloading it. |\n| `dispose()` | `void` | Stop loops, remove listeners, dispose Three.js resources, and end the session. |\n\n#### Events and scene access\n\nThe `onLocalizationSuccess` / `onXRFrame` options are single-slot: setting one replaces it. Use these\nlisteners instead when more than one part of your app needs to react — anything layered on top of\nthe adapter (`MapSpace`, `Navigation`, your own code) uses them, so they compose.\n\nEvery `add*Listener` **returns its own unsubscribe function**, which is usually easier than keeping\na reference for the matching `remove*Listener`.\n\n| Method | Returns | Description |\n|---|---|---|\n| `addLocalizationListener(fn)` | `() => void` | `fn(result, worldFromMap)` after every successful localization. |\n| `removeLocalizationListener(fn)` | `void` | Unsubscribe. Equivalent to calling the returned function. |\n| `addSessionStartListener(fn)` | `() => void` | Fires when the AR session starts. |\n| `removeSessionStartListener(fn)` | `void` | Unsubscribe. |\n| `addSessionEndListener(fn)` | `() => void` | Fires when the AR session ends. |\n| `removeSessionEndListener(fn)` | `void` | Unsubscribe. |\n| `addFrameListener(fn)` | `() => void` | `fn(event)` every XR frame, after camera matrices are synced and before the scene renders — so anything you move lands in the same frame. |\n| `removeFrameListener(fn)` | `void` | Unsubscribe. |\n| `waitForLocalization()` | `Promise<ILocalizeAndMapDetails>` | Resolves immediately if this session has already localized, otherwise on the next success. Never rejects. Replaces the usual \"do X once we are localized\" callback dance. |\n| `getLastLocalization()` | `ILocalizationSnapshot \\| null` | The current session's most recent result plus its `worldFromMap`. Cleared on session end, so a stale pose can never be replayed into a new session. |\n| `getScene()` | `THREE.Scene` | The scene passed in options. |\n| `getCamera()` | `THREE.Camera` | The XR-driven camera. **Read its pose with `getWorldPosition()` / `matrixWorld`, never `camera.position`** — see the warning under [Placing Content](#placing-content-at-map-coordinates). |\n\n---\n\n### `NeedleAdapter`\n\nNeedle Engine `Behaviour` that wires `XRSessionManager` to Needle's renderer and scene. Handles XR framebuffer binding, camera matrix sync, AR passthrough (transparent background), and optional map mesh / gizmo / object mesh display.\n\n```typescript\nimport { NeedleAdapter } from '@multisetai/vps/needle';\n\nnew NeedleAdapter(options: INeedleAdapterOptions)\n```\n\nAdd to a scene via `addNewComponent(gameObject, adapter)` — this triggers `awake()`, which creates the session and mounts the button.\n\n#### `INeedleAdapterOptions`\n\n| Parameter | Type | Description |\n|---|---|---|\n| `client` | `MultisetClient` | Required. |\n| `sessionOptions?` | `Omit<IXRSessionOptions, 'client'>` | All session options and callbacks — forwarded directly to `XRSessionManager`. See [IXRSessionOptions](#ixrsessionoptions) for the full list. |\n| `showMesh?` | `boolean` | Show the VPS map mesh after localization. Default `false`. |\n| `occlusion?` | `boolean` | Load the map mesh as an invisible occluder after localization, so virtual content behind real-world geometry is hidden. Takes precedence over `showMesh`. Default `false`. See [Occlusion](#occlusion). |\n| `useActiveMapVersion?` | `boolean` | For a map in a Map Version, show the active (newest) scan's mesh, placed in the base map's frame, instead of the base scan's. Default `false`. See [Map Versions](#map-versions). |\n| `showGizmo?` | `boolean` | Show a transform gizmo after localization. Default `false`. |\n| `showObjectMeshes?` | `boolean` | Load and display a 3D outline mesh for each detected object. Default `false`. |\n| `useDefaultButton?` | `boolean` | Mount the built-in START AR / STOP AR button automatically in `awake()`. Default `true`. Set to `false` to drive the session via `startSession()` / `stopSession()`. |\n| `buttonContainer?` | `HTMLElement` | Where to append the built-in button. Defaults to `overlayRoot` or `document.body`. |\n| `onButtonCreated?` | `(button: HTMLButtonElement) => void` | Called after the built-in button is created. |\n| `onXRFrame?` | `(event: IXRFrameEvent) => void` | Called every XR frame after camera matrices are synced, before the scene is rendered. |\n| `onLocalizationSuccess?` | `(result: ILocalizeAndMapDetails, worldFromMap: THREE.Matrix4) => void` | Called after a successful VPS localization. `worldFromMap` transforms map-space coordinates to Three.js world space. |\n| `onObjectMeshLoaded?` | `(objectCode: string) => void` | Called when a detected object's 3D mesh has been loaded and placed in the scene. Only fires when `showObjectMeshes: true`. |\n\n#### Static methods\n\n| Method | Returns | Description |\n|---|---|---|\n| `NeedleAdapter.isSupported()` | `Promise<boolean>` | Returns `true` if the browser supports `immersive-ar` WebXR sessions. |\n\n#### Methods\n\n| Method | Returns | Description |\n|---|---|---|\n| `isActive()` | `boolean` | Whether an XR session is currently running. |\n| `isLocalizing` | `boolean` | Whether a localization or tracking run is currently in progress. |\n| `startSession()` | `Promise<void>` | Start an AR session. **Must be called from within a user gesture handler.** |\n| `stopSession()` | `void` | Stop the active AR session. No-op if no session is running. |\n| `localizeFrame()` | `Promise<ILocalizeAndMapDetails \\| null>` | Capture and localize one frame. |\n| `trackObjects()` | `Promise<IObjectTrackingResponse \\| null>` | Capture one frame and run object detection. Requires `mapType: 'object-tracking'` on the client. |\n| `clearObjectMeshes()` | `void` | Remove all object meshes placed by `showObjectMeshes`. |\n| `setOcclusion(enabled)` | `void` | Turn map-mesh occlusion on or off at runtime. Swaps the material on the loaded mesh, or fetches the mesh for the last localization if none is loaded. Takes precedence over `setShowMesh()`. |\n| `setShowMesh(enabled)` | `void` | Show or hide the map mesh overlay at runtime, without re-downloading it. Both are safe to call before `awake()`. |\n| `registerAnchor(anchor)` | `void` | Connect a dynamically created `MapAnchor` to the adapter. Registers localization listeners and immediately applies the last localization result if the session is already active. |\n| `getSession()` | `XRSessionManager` | Access the underlying session manager directly. Use only when you need low-level session control — for example `getSession().getOverlayRoot()` to mount UI that receives taps during AR. |\n\n#### Events and scene access\n\nIdentical to [`ThreeAdapter`](#threeadapter) — both adapters satisfy the same\n[`IVpsAdapter`](#ivpsadapter) contract, which is what lets features like `MapSpace` and\n`Navigation` work on either without change.\n\nEvery `add*Listener` **returns its own unsubscribe function**. Either call that or the matching\n`remove*Listener` from your component's `onDestroy` — skipping it leaves the adapter holding a\nreference to a destroyed component.\n\n| Method | Returns | Description |\n|---|---|---|\n| `addLocalizationListener(fn)` | `() => void` | `fn(result, worldFromMap)` after every successful localization. Prefer this over the constructor's `onLocalizationSuccess` when several components need to react. |\n| `removeLocalizationListener(fn)` | `void` | Unsubscribe. |\n| `addSessionStartListener(fn)` | `() => void` | Fires when AR begins. Useful for showing in-session UI. |\n| `removeSessionStartListener(fn)` | `void` | Unsubscribe. |\n| `addSessionEndListener(fn)` | `() => void` | Fires when AR ends. Useful for hiding anchored content between sessions. |\n| `removeSessionEndListener(fn)` | `void` | Unsubscribe. |\n| `addFrameListener(fn)` | `() => void` | `fn(event)` every XR frame, after camera matrices are synced and before the scene renders. |\n| `removeFrameListener(fn)` | `void` | Unsubscribe. |\n| `waitForLocalization()` | `Promise<ILocalizeAndMapDetails>` | Resolves immediately if this session has already localized, otherwise on the next success. Never rejects. |\n| `getLastLocalization()` | `ILocalizationSnapshot \\| null` | The current session's most recent result plus its `worldFromMap`. Cleared on session end. |\n| `getScene()` | `THREE.Scene` | Needle's scene. |\n| `getCamera()` | `THREE.Camera` | The XR-driven camera. **Read its pose with `getWorldPosition()` / `matrixWorld`, never `camera.position`.** |\n\n---\n\n### `IVpsAdapter`\n\nThe surface shared by `ThreeAdapter` and `NeedleAdapter`. Type against this and your code works on\neither — and on any future adapter.\n\n```typescript\nimport type { IVpsAdapter } from '@multisetai/vps/three';\n\nfunction attachMyFeature(adapter: IVpsAdapter) {\n  const off = adapter.addLocalizationListener((result, worldFromMap) => { /* ... */ });\n  return off;\n}\n```\n\nBoth adapters satisfy it **structurally** — neither declares `implements IVpsAdapter` — and a\ncompile-time guard in each entry point fails the build if one drifts from the interface.\n\nIt covers: `isActive()`, `isLocalizing`, `getScene()`, `getCamera()`, `getLastLocalization()`, the\nfour `add*Listener` / `remove*Listener` pairs, `waitForLocalization()`, `startSession()`,\n`stopSession()`, `localizeFrame()` and `trackObjects()`. This is what `MapSpace` and `Navigation`\ndepend on, which is why neither imports a concrete adapter.\n\n`ILocalizationSnapshot` is `{ result: ILocalizeAndMapDetails; worldFromMap: THREE.Matrix4 }`.\n\n---\n\n### `MapSpace`\n\nThe VPS map coordinate frame. Nest your map-anchored content under it, and on every successful\nlocalization it is moved so its origin coincides with the scanned map's origin — every descendant\nfollows by ordinary parenting.\n\n**A child's local position is therefore its map coordinate.** That is what makes it cheap:\nrelocalization, background localization and session restarts change only this one transform, so\nnothing computed relative to it ever needs recomputing.\n\nIt exists in two forms, and they are the same object:\n\n| | Import | Use in |\n|---|---|---|\n| **Package class** | `import { MapSpace } from '@multisetai/vps/three'` | plain three.js, or from code in a Needle project |\n| **Needle component** | `import { MapSpace } from './MapSpace.js'` | Unity — a [template file](#unity-inspector-workflow) you copy into `src/scripts/` |\n\nThe template is a thin `Behaviour` that owns a package `MapSpace` bound to its GameObject and\nforwards to it, so behaviour is identical. The Unity→three.js handedness correction lives in the\npackage class — one verified implementation rather than a copy in every project.\n\n```typescript\nimport { MapSpace } from '@multisetai/vps/three';\n\nconst mapSpace = new MapSpace(new THREE.Object3D());\nscene.add(mapSpace.object);\nmapSpace.connect(adapter);                                  // ThreeAdapter or NeedleAdapter\n\nmapSpace.add(marker, new THREE.Vector3(1.5, 0, -2));        // position IS a map coordinate\n```\n\n#### Options and fields\n\n| Name | Type | Default | Description |\n|---|---|---|---|\n| `hideUntilLocalized` | `boolean` | `true` | Hide the object until the first localization, and re-hide on session end. Read live, so you can set it to `false` at runtime to keep content visible between sessions. **In Needle this deactivates the entire subtree** — see the [setup notes](#mapspace--anchoring-a-whole-subtree-unity). |\n\n#### Methods\n\n| Method | Returns | Description |\n|---|---|---|\n| `connect(adapter)` | `void` | Subscribe to an adapter so this frame is placed on every localization. Safe to call repeatedly — previous subscriptions are removed first. If the adapter has already localized in the current session, that result is replayed immediately, so a `MapSpace` created mid-session is placed at once. |\n| `disconnect()` | `void` | Remove every subscription made by `connect()`. |\n| `applyLocalization(result, worldFromMap)` | `void` | Place the frame directly, bypassing events. Useful in tests, or from a component that receives the result by its own route. |\n| `add(object, mapCoordinate?)` | `void` | Parent an object to this frame, optionally at a map coordinate. |\n| `mapToWorld(v, target?)` | `THREE.Vector3` | Map space → world space. |\n| `worldToMap(v, target?)` | `THREE.Vector3` | World space → map space. Use this to convert the camera pose before any map-space calculation. |\n| `dispose()` | `void` | Same as `disconnect()`. |\n| `object` | `THREE.Object3D` | *Getter.* The wrapped object — add it to your scene. |\n| `isLocalized` | `boolean` | *Getter.* True once a localization has been applied in the current session. |\n| `MapSpace.toLocal(unityCoord, target?)` | `THREE.Vector3` | **Static.** Convert a Unity/left-handed coordinate copied from the portal's Map Viewer into map space. Editor-authored children get this from Needle's exporter and must **not** use it; content created in code must. |\n\n#### In Unity\n\n`MultisetVPS` discovers and wires all `MapSpace` components at startup. A scene should contain\nexactly one — `MultisetVPS` warns if it finds more, since they would all be moved to the same\norigin. The Needle component also exposes `connectAdapter(adapter)` and\n`applyLocalization(result, worldFromMap)`, matching `MapAnchor`, so it can be registered at runtime\nwith `NeedleAdapter.registerAnchor(mapSpace)`. Reach the underlying package object through\n`.space` — for example `mapSpace.space.worldToMap(...)`.\n\n---\n\n### `MapAnchor`\n\nNeedle Engine `Behaviour` that anchors a single GameObject to the VPS map origin after localization.\n\n> **Not exported from the package** — `MapAnchor` is a [template file](#unity-inspector-workflow) you copy into your own `src/scripts/` folder. Import it relatively: `import { MapAnchor } from './MapAnchor.js'`.\n\nIn Unity, add the component via the Inspector — `MultisetVPS` discovers and wires all `MapAnchor` instances at startup automatically. For laying out multiple POIs, prefer [`MapSpace`](#mapspace). Do not nest a `MapAnchor` inside a `MapSpace` — the offset would be applied twice.\n\nFor runtime-spawned objects use `NeedleAdapter.registerAnchor()` (see [MapAnchor — zero-code object placement](#mapanchor--zero-code-object-placement-unity) above).\n\n#### Fields\n\n| Field | Type | Default | Description |\n|---|---|---|---|\n| `offset` | `THREE.Vector3` | `(0, 0, 0)` | Position offset from the map origin in metres. When `isRightHanded` is `false` (default), enter Unity Inspector values directly — X is negated automatically. When `true`, supply Three.js values as-is. |\n| `matchOrientation` | `boolean` | `true` | Align the object's rotation to the map's orientation. |\n| `rotationOffset` | `THREE.Euler` | `(0°, 0°, 0°)` | Additional rotation applied on top of the map orientation. Only appl","readmeFilename":"README.md"}