@bro-sdk/core
v0.1.0
Published
Core SDK for Bro analytics & push notifications platform
Readme
@bro-sdk/core
Core SDK for Bro — analytics & push notifications platform.
This is an internal package used by
@bro-sdk/weband@bro-sdk/react-native. You don't need to install it directly — it's included as a dependency.
What's inside
BroClient— abstract base class with event tracking, identity, sessionsEventQueue— batched event queue with auto-flushTransport— HTTP transport for the Bro APISessionManager— automatic 30-minute session windows- TypeScript types (
BroConfig,BroEvent,BroContext,IdentifyTraits)
For SDK authors
If you're building a custom Bro SDK for a new platform, extend BroClient:
import { BroClient, type BroConfig, type BroContext } from "@bro-sdk/core";
class BroCustom extends BroClient {
getContext(): BroContext {
return { userAgent: "MyPlatform/1.0" };
}
getPersistedAnonymousId(): string | null {
return myStorage.get("bro_anon_id");
}
setPersistedAnonymousId(id: string): void {
myStorage.set("bro_anon_id", id);
}
getPersistedUserId(): string | null {
return myStorage.get("bro_user_id");
}
setPersistedUserId(id: string): void {
myStorage.set("bro_user_id", id);
}
}License
MIT
