@serotech/appkit
| Install | |
|---|---|
npm install @serotech/appkit |
|
| Latest Version: | 0.1.0 |
| License: | MIT |
| Last Updated: | Sep 21, 2026 |
| Links: | npm |
@serotech/appkit
Server-side personalization client for Sero CDP: the data the Sero pixel personalizes in the browser, as JSON for your own server — headless storefronts (Next.js, Nuxt, Remix, Astro), apps, e-mail renderers, chatbots, POS.
Zero dependencies. Node 18+, edge runtimes, Bun, Deno.
npm i @serotech/appkit
import { createSeroAppKit, visitorFromCookie } from '@serotech/appkit';
const sero = createSeroAppKit({ apiKey: process.env.SERO_CDP_API_KEY!, baseUrl: 'https://cdp.sero.tech' });
// Next.js App Router route handler
export async function GET(req: Request) {
const visitor = visitorFromCookie(req.headers.get('cookie')); // { anonymous_id } from the pixel cookie
const { products } = await sero.recommendations({ visitor, type: 'personal', limit: 8 });
return Response.json(products);
}
| Method | What you get |
|---|---|
context({ visitor }) |
Who this is: name, country, budget band, intent, top categories, favourites, cart/viewed/purchased ids, declared attributes, segments, sticky A/B assignments |
productSets() |
Your active product sets |
productSet(id, { visitor, limit, exclude_purchased, exclude_in_cart }) |
A product set ranked for this visitor |
recommendations({ visitor, type, product_id, category, limit }) |
personal · similar · category · popular · recently_viewed |
decide({ visitor, page_url, page_type, product_id }) |
The full decision as data: experiments (with content), personalization rules, blocks, goals, social proof |
track.exposures(visitor, decision) / track.click(visitor, id) / track.goal(visitor, id) |
Report what happened, so tests and the engine keep learning |
safe(() => …) |
Same call, null instead of an exception |
The key needs the personalization_read scope (plus events_write for track.*).
Full guide with Nuxt, Shopify App Proxy and PHP examples: https://cdp.sero.tech/api/v1/appkit.md.
Identity
The pixel stores its visitor id in the first-party cookie _sero_vid (after consent).
Pass it as anonymous_id and the visitor gets the same experiment variant server-side as in the
browser. Known customers: pass email or email_sha256. No id: you get the anonymous default,
never an error.
In the browser: sero('getIds', (ids) => ids.visitor_id).
Related Packages
Generic Vue 3 bindings for the BIMETAL component family: useController + one com...
Version History
| Version | Released | License |
|---|---|---|
| 0.1.0 | MIT |