Files
zeekay e43ab1afe7 chore: rename all PostHog references to Insights/Hanzo
Bulk rename across 989 files:
- Package names: posthog-js → @hanzo/insights, posthog-node → @hanzo/insights-node, etc.
- Repository URLs: posthog/posthog-js → hanzoai/insights-js
- Brand names: PostHog → Insights
- File renames: 259 reference JSON files, source files, workflow files
- Directory rename: eslint-plugin-posthog-js → eslint-plugin-insights

Remaining: 8 refs to @posthog/rrweb-* (real npm deps, need fork+publish)
2026-03-06 01:41:12 -08:00

61 lines
1.9 KiB
HTML

<script src="../../dist/array.js"></script>
<script>
insights.init('sTMFPsFhdP1Ssg', {
api_host: 'http://127.0.0.1:8000',
autocapture: {
capture_copied_text: true,
},
debug: true,
persistence: 'memory',
loaded: function(insights) {
insights.identify('test')
},
before_send: (event) => {
if (event.event === '$copy_autocapture') {
const selectionType = event.properties['$copy_type']
const selectionText = event.properties['$selected_content']
document.getElementById('selection-type-outlet').innerText = selectionType
document.getElementById('selection-text-outlet').innerText = selectionText
}
return event
},
})
</script>
<h2>Demo site for Copy/Cut Autocapture</h2>
<button>Here's a button you could click if you want to</button><br /><br />
<body>
<div>
<a href="https://insights.hanzo.ai">Here's a link to the outside world</a>
</div>
<div id="shadow"></div>
<div style="padding: 2rem;background:green;display:none;color:white" id="feature"><h2>Look, a new beta feature</h2>
</div>
<div>
<p>This input is a password we shouldn't copy that</p>
<input value="i am secret" type="password" />
</div>
<div>
<p>The value below is marked no capture so we shouldn't copy that</p>
<div class='ph-no-capture'>I am a secret</div>
</div>
<div>
<h2>Result of selection autocapture</h2>
<p>Selection type is:
<div id="selection-type-outlet"></div>
</p>
<p>Selected text is:
<div id="selection-text-outlet"></div>
</p>
</div>
<script>
const header = document.createElement('header')
const shadowRoot = header.attachShadow({ mode: 'open' })
shadowRoot.innerHTML = '<div style="border: black 1px solid"><h2>shadowroot</h2><input value="some input text">bla</input></div>'
document.body.prepend(header)
</script>
</body>