@meownitor/core 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,8 @@
1
+ type InitOptions = {
2
+ env?: string;
3
+ };
4
+ declare const init: (projectKey: string, options?: InitOptions) => void;
5
+ type EventData = Record<string, unknown>;
6
+ declare const track: (eventName: string, eventData: EventData) => void;
7
+
8
+ export { type EventData, type InitOptions, init, track };
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ var e,r="test",t=(t,n)=>{e=t,n?.env&&(r=n.env)},n=(t,n)=>{if(!e)throw new Error("init() is required");navigator.sendBeacon(`https://api.meownitor.dev/${e}/${r}/${t}`,new URLSearchParams({d:JSON.stringify(n),t:String(Date.now())}))};export{t as init,n as track};
package/package.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "@meownitor/core",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "scripts": {
6
+ "build": "tsup"
7
+ },
8
+ "files": [
9
+ "dist/index.js",
10
+ "dist/index.d.ts"
11
+ ],
12
+ "exports": {
13
+ ".": {
14
+ "import": "./dist/index.js",
15
+ "types": "./dist/index.d.ts"
16
+ }
17
+ },
18
+ "publishConfig": {
19
+ "access": "public"
20
+ }
21
+ }