sleek-analytics
v2.0.4
Published
Add Sleek Analytics to any framework in seconds
Maintainers
Readme
Sleek Analytics
Add Sleek Analytics to any web framework in seconds. Privacy-first, lightweight web analytics.
npx sleek-analytics initHow it works
- Detects your framework automatically
- Asks for your Site ID (from your Sleek dashboard)
- Injects the analytics script into the right file
That's it. No config files, no wrappers, no build plugins.
Supported frameworks
| Framework | How it injects |
|-----------|---------------|
| Next.js (App Router) | <Script> component in app/layout |
| Next.js (Pages Router) | <Script> component in pages/_app |
| React (Vite / CRA) | <script> tag in index.html |
| Vue.js | <script> tag in index.html |
| Nuxt.js | app.head.script in nuxt.config |
| SvelteKit | <svelte:head> in +layout.svelte |
| Remix | <script> tag in app/root |
| Astro | <script> tag in layout .astro file |
| Gatsby | setHeadComponents in gatsby-ssr.js |
| WordPress | wp_head hook in functions.php |
| HTML / Static | <script> tag in index.html |
Usage
Quick setup
npx sleek-analytics initGlobal install
npm i -g sleek-analytics
sleek-analytics initWhat gets added
A single async script tag pointing to your Sleek instance:
<script async src="https://getsleek.io/v1.js" data-site="YOUR_SITE_ID"></script>The script is ~1KB, loads asynchronously, and doesn't slow down your site.
Requirements
- Node.js >= 16
License
MIT
