@siteline/core 1.0.6 → 1.0.7

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.
package/README.md CHANGED
@@ -48,10 +48,10 @@ new Siteline(config: SitelineConfig)
48
48
 
49
49
  **Configuration Options:**
50
50
 
51
- | Option | Type | Required | Description |
52
- |--------|------|----------|-------------|
53
- | `websiteKey` | `string` | Yes | Your Siteline website key |
54
- | `endpoint` | `string` | No | Custom API endpoint (default: https://api.siteline.ai/v1/intake/pageview) |
51
+ | Option | Type | Required | Description |
52
+ |--------|------|----------|---------------------------------------|
53
+ | `websiteKey` | `string` | Yes | Your Siteline website key |
54
+ | `endpoint` | `string` | No | Custom API endpoint |
55
55
  | `debug` | `boolean` | No | Enable debug logging (default: false) |
56
56
 
57
57
  ### track()
@@ -80,14 +80,13 @@ For framework-specific integrations with automatic tracking:
80
80
 
81
81
  ## Documentation
82
82
 
83
- - [Full Documentation](https://docs.gptrends.io/agent-analytics)
84
- - [API Reference](https://api.siteline.ai/docs)
85
- - [GitHub Repository](https://github.com/siteline-ai/siteline-sdk-js)
83
+ - [Full Documentation](https://docs.gptrends.io/integrations/javascript)
84
+ - [GitHub Repository](https://github.com/siteline-ai/siteline-js-sdk)
86
85
 
87
86
  ## Support
88
87
 
89
- - [GitHub Issues](https://github.com/siteline-ai/siteline-sdk-js/issues)
90
- - Email: support@siteline.ai
88
+ - [GitHub Issues](https://github.com/siteline-ai/siteline-js-sdk/issues)
89
+ - Email: team@siteline.ai
91
90
 
92
91
  ## License
93
92
 
@@ -1,8 +1,8 @@
1
- export declare const DEFAULT_ENDPOINT = "https://api.gptrends.io/v1/intake/pageview";
2
- export declare const DEFAULT_SDK_NAME = "@siteline/core";
1
+ export declare const DEFAULT_ENDPOINT = "https://api.siteline.ai/v1/intake/pageview";
2
+ export declare const DEFAULT_SDK_NAME = "@siteline/js";
3
3
  export declare const DEFAULT_SDK_VERSION = "1.0.6";
4
- export declare const DEFAULT_INTEGRATION_TYPE = "custom";
5
- export declare const WEBSITEKEY_PATTERN: RegExp;
4
+ export declare const DEFAULT_INTEGRATION_TYPE = "js";
5
+ export declare const WEBSITE_KEY_REGEX: RegExp;
6
6
  export declare const LIMITS: {
7
7
  readonly URL_MAX_LENGTH: 2048;
8
8
  readonly METHOD_MAX_LENGTH: 10;
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,+CAA+C,CAAC;AAC7E,eAAO,MAAM,gBAAgB,mBAAmB,CAAC;AACjD,eAAO,MAAM,mBAAmB,UAAU,CAAC;AAC3C,eAAO,MAAM,wBAAwB,WAAW,CAAC;AAEjD,eAAO,MAAM,kBAAkB,QAAwC,CAAC;AAExE,eAAO,MAAM,MAAM;;;;;;;;;;;;;CAaT,CAAC;AAEX,eAAO,MAAM,UAAU,OAAO,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,+CAA+C,CAAC;AAC7E,eAAO,MAAM,gBAAgB,iBAAiB,CAAC;AAC/C,eAAO,MAAM,mBAAmB,UAAU,CAAC;AAC3C,eAAO,MAAM,wBAAwB,OAAO,CAAC;AAC7C,eAAO,MAAM,iBAAiB,QAAiD,CAAC;AAEhF,eAAO,MAAM,MAAM;;;;;;;;;;;;;CAaT,CAAC;AAEX,eAAO,MAAM,UAAU,OAAO,CAAC"}
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";class e extends Error{constructor(e){super(e),this.name="SitelineError"}}class t extends e{constructor(e){super(e),this.name="SitelineValidationError"}}const i=/^(siteline_secret|gptrends_secret)_/;exports.Siteline=class{constructor(e){if(!e.websiteKey?.match(i))throw new t("Invalid websiteKey format. Expected: siteline_secret_<32 hex chars>");this.key=e.websiteKey,this.endpoint=e.endpoint||"https://api.gptrends.io/v1/intake/pageview",this.debug=e.debug||!1,this.sdk=e.sdk||"@siteline/core",this.sdkVersion=e.sdkVersion||"1.0.6",this.integrationType=e.integrationType||"custom",this.debug&&console.log("[Siteline] Siteline initialized")}async track(e){const t=this.sanitize(e);try{return await this.send(t)}catch(e){this.debug&&console.error("[Siteline] Track failed:",e.message)}}sanitize(e){return{websiteKey:this.key,url:(e.url+"").slice(0,2048),method:(e.method+"").toUpperCase().slice(0,10),status:Math.max(0,Math.min(999,Number(e.status)||0)),duration:Math.max(0,Math.min(3e5,Number(e.duration)||0)),userAgent:e.userAgent?(e.userAgent+"").slice(0,512):null,ref:e.ref?(e.ref+"").slice(0,2048):null,ip:e.ip?(e.ip+"").slice(0,45):null,integrationType:this.integrationType.slice(0,50),sdk:this.sdk.slice(0,50),sdkVersion:this.sdkVersion.slice(0,20)}}async send(e){const t=new AbortController,i=setTimeout(()=>t.abort(),5e3);try{const i=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","User-Agent":`${this.sdk}/${this.sdkVersion}`},body:JSON.stringify(e),signal:t.signal});this.debug&&(i.ok?console.log("[Siteline] Tracked:",e.url,{endpoint:this.endpoint,sdk:this.sdk,sdkVersion:this.sdkVersion,integrationType:this.integrationType}):console.error("[Siteline] HTTP error:",i.status))}catch(e){this.debug&&console.error("[Siteline] Network error:",e.message)}finally{clearTimeout(i)}}},exports.SitelineError=e,exports.SitelineTransportError=class extends e{constructor(e){super(e),this.name="SitelineTransportError"}},exports.SitelineValidationError=t;
1
+ "use strict";class e extends Error{constructor(e){super(e),this.name="SitelineError"}}class t extends e{constructor(e){super(e),this.name="SitelineValidationError"}}const i=/^(siteline|gptrends)_secret_[A-Za-z0-9]{32}$/;exports.Siteline=class{constructor(e){if(!e.websiteKey)throw new t("[Siteline] Missing websiteKey.");if(!i.test(e.websiteKey))throw new t("[Siteline] Invalid websiteKey format.");this.key=e.websiteKey,this.endpoint=e.endpoint||"https://api.siteline.ai/v1/intake/pageview",this.debug=e.debug||!1,this.sdk=e.sdk||"@siteline/js",this.sdkVersion=e.sdkVersion||"1.0.6",this.integrationType=e.integrationType||"js",this.debug&&console.log("[Siteline] Siteline initialized")}async track(e){const t=this.sanitize(e);try{return await this.send(t)}catch(e){this.debug&&console.error("[Siteline] Track failed:",e.message)}}sanitize(e){return{websiteKey:this.key,url:(e.url+"").slice(0,2048),method:(e.method+"").toUpperCase().slice(0,10),status:Math.max(0,Math.min(999,Number(e.status)||0)),duration:Math.max(0,Math.min(3e5,Number(e.duration)||0)),userAgent:e.userAgent?(e.userAgent+"").slice(0,512):null,ref:e.ref?(e.ref+"").slice(0,2048):null,ip:e.ip?(e.ip+"").slice(0,45):null,integrationType:this.integrationType.slice(0,50),sdk:this.sdk.slice(0,50),sdkVersion:this.sdkVersion.slice(0,20)}}async send(e){const t=new AbortController,i=setTimeout(()=>t.abort(),5e3);try{const i=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","User-Agent":`${this.sdk}/${this.sdkVersion}`},body:JSON.stringify(e),signal:t.signal});this.debug&&(i.ok?console.log("[Siteline] Tracked:",e.url,{endpoint:this.endpoint,sdk:this.sdk,sdkVersion:this.sdkVersion,integrationType:this.integrationType}):console.error("[Siteline] HTTP error:",i.status))}catch(e){this.debug&&console.error("[Siteline] Network error:",e.message)}finally{clearTimeout(i)}}},exports.SitelineError=e,exports.SitelineTransportError=class extends e{constructor(e){super(e),this.name="SitelineTransportError"}},exports.SitelineValidationError=t;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../src/errors.ts","../src/constants.ts","../src/siteline.ts"],"sourcesContent":[null,null,null],"names":["SitelineError","Error","constructor","message","super","this","name","SitelineValidationError","WEBSITEKEY_PATTERN","config","websiteKey","match","key","endpoint","debug","sdk","sdkVersion","integrationType","console","log","track","data","sanitized","sanitize","send","err","error","url","String","slice","method","toUpperCase","status","Math","max","min","Number","duration","userAgent","ref","ip","controller","AbortController","timeout","setTimeout","abort","res","fet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jD3B,MCiDuD,KACnEW,GAAInB,EAAKmB,IAAYnB,EAAKmB,GAAZZ,IAAgBC,MAAM,EDjDzB,ICiDoD,KAC/DZ,gBAAiBZ,KAAKY,gBAAgBY,MAAM,EDjDnB,ICkDzBd,IAAKV,KAAKU,IAAIc,MAAM,EDjDR,ICkDZb,WAAYX,KAAKW,WAAWa,MAAM,EDjDd,ICmDxB,CAEQ,UAAML,CAAKH,GACjB,MAAMoB,EAAa,IAAIC,gBACjBC,EAAUC,WAAW,IAAMH,EAAWI,QDhDtB,KCkDtB,IACE,MAAMC,QAAYC,MAAM1C,KAAKQ,SAAU,CACrCiB,OAAQ,OACRkB,QAAS,CACP,eAAgB,mBAChB,aAAc,GAAG3C,KAAKU,OAAOV,KAAKW,cAEpCiC,KAAMC,KAAKC,UAAU9B,GACrB+B,OAAQX,EAAWW,SAGjB/C,KAAKS,QACHgC,EAAIO,GACNnC,QAAQC,IAAI,sBAAuBE,EAAKM,IAAK,CAC3Cd,SAAUR,KAAKQ,SACfE,IAAKV,KAAKU,IACVC,WAAYX,KAAKW,WACjBC,gBAAiBZ,KAAKY,kBAGxBC,QAAQQ,MAAM,yBAA0BoB,EAAId,QAGlD,CAAE,MAAOP,GACHpB,KAAKS,OAEPI,QAAQQ,MAAM,4BADAD,EACmCtB,QAErD,SACEmD,aAAaX,EACf,CACF,0DFzFI,cAAsC3C,EAC1C,WAAAE,CAAYC,GACVC,MAAMD,GACNE,KAAKC,KAAO,wBACd"}
1
+ {"version":3,"file":"index.cjs","sources":["../src/errors.ts","../src/constants.ts","../src/siteline.ts"],"sourcesContent":[null,null,null],"names":["SitelineError","Error","constructor","message","super","this","name","SitelineValidationError","WEBSITE_KEY_REGEX","config","websiteKey","test","key","endpoint","debug","sdk","sdkVersion","integrationType","console","log","track","data","sanitized","sanitize","send","err","error","url","String","slice","method","toUpperCase","status","Math","max","min","Number","duration","userAgent","ref","ip","controller","AbortController","timeout","setTimeout","abort","res","fetch","headers","body","JSON","stringify","signal","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KkB,IAAZX,IAAiBC,MAAM,EDnD3B,MCmDuD,KACnEW,GAAInB,EAAKmB,IAAYnB,EAAKmB,GAAZZ,IAAgBC,MAAM,EDnDzB,ICmDoD,KAC/DZ,gBAAiBZ,KAAKY,gBAAgBY,MAAM,EDnDnB,ICoDzBd,IAAKV,KAAKU,IAAIc,MAAM,EDnDR,ICoDZb,WAAYX,KAAKW,WAAWa,MAAM,EDnDd,ICqDxB,CAEQ,UAAML,CAAKH,GACjB,MAAMoB,EAAa,IAAIC,gBACjBC,EAAUC,WAAW,IAAMH,EAAWI,QDlDtB,KCoDtB,IACE,MAAMC,QAAYC,MAAM1C,KAAKQ,SAAU,CACrCiB,OAAQ,OACRkB,QAAS,CACP,eAAgB,mBAChB,aAAc,GAAG3C,KAAKU,OAAOV,KAAKW,cAEpCiC,KAAMC,KAAKC,UAAU9B,GACrB+B,OAAQX,EAAWW,SAGjB/C,KAAKS,QACHgC,EAAIO,GACNnC,QAAQC,IAAI,sBAAuBE,EAAKM,IAAK,CAC3Cd,SAAUR,KAAKQ,SACfE,IAAKV,KAAKU,IACVC,WAAYX,KAAKW,WACjBC,gBAAiBZ,KAAKY,kBAGxBC,QAAQQ,MAAM,yBAA0BoB,EAAId,QAGlD,CAAE,MAAOP,GACHpB,KAAKS,OAEPI,QAAQQ,MAAM,4BADAD,EACmCtB,QAErD,SACEmD,aAAaX,EACf,CACF,0DF1FI,cAAsC3C,EAC1C,WAAAE,CAAYC,GACVC,MAAMD,GACNE,KAAKC,KAAO,wBACd"}
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- class e extends Error{constructor(e){super(e),this.name="SitelineError"}}class t extends e{constructor(e){super(e),this.name="SitelineValidationError"}}class s extends e{constructor(e){super(e),this.name="SitelineTransportError"}}const i=/^(siteline_secret|gptrends_secret)_/;class n{constructor(e){if(!e.websiteKey?.match(i))throw new t("Invalid websiteKey format. Expected: siteline_secret_<32 hex chars>");this.key=e.websiteKey,this.endpoint=e.endpoint||"https://api.gptrends.io/v1/intake/pageview",this.debug=e.debug||!1,this.sdk=e.sdk||"@siteline/core",this.sdkVersion=e.sdkVersion||"1.0.6",this.integrationType=e.integrationType||"custom",this.debug&&console.log("[Siteline] Siteline initialized")}async track(e){const t=this.sanitize(e);try{return await this.send(t)}catch(e){this.debug&&console.error("[Siteline] Track failed:",e.message)}}sanitize(e){return{websiteKey:this.key,url:(e.url+"").slice(0,2048),method:(e.method+"").toUpperCase().slice(0,10),status:Math.max(0,Math.min(999,Number(e.status)||0)),duration:Math.max(0,Math.min(3e5,Number(e.duration)||0)),userAgent:e.userAgent?(e.userAgent+"").slice(0,512):null,ref:e.ref?(e.ref+"").slice(0,2048):null,ip:e.ip?(e.ip+"").slice(0,45):null,integrationType:this.integrationType.slice(0,50),sdk:this.sdk.slice(0,50),sdkVersion:this.sdkVersion.slice(0,20)}}async send(e){const t=new AbortController,s=setTimeout(()=>t.abort(),5e3);try{const s=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","User-Agent":`${this.sdk}/${this.sdkVersion}`},body:JSON.stringify(e),signal:t.signal});this.debug&&(s.ok?console.log("[Siteline] Tracked:",e.url,{endpoint:this.endpoint,sdk:this.sdk,sdkVersion:this.sdkVersion,integrationType:this.integrationType}):console.error("[Siteline] HTTP error:",s.status))}catch(e){this.debug&&console.error("[Siteline] Network error:",e.message)}finally{clearTimeout(s)}}}export{n as Siteline,e as SitelineError,s as SitelineTransportError,t as SitelineValidationError};
1
+ class e extends Error{constructor(e){super(e),this.name="SitelineError"}}class t extends e{constructor(e){super(e),this.name="SitelineValidationError"}}class i extends e{constructor(e){super(e),this.name="SitelineTransportError"}}const s=/^(siteline|gptrends)_secret_[A-Za-z0-9]{32}$/;class n{constructor(e){if(!e.websiteKey)throw new t("[Siteline] Missing websiteKey.");if(!s.test(e.websiteKey))throw new t("[Siteline] Invalid websiteKey format.");this.key=e.websiteKey,this.endpoint=e.endpoint||"https://api.siteline.ai/v1/intake/pageview",this.debug=e.debug||!1,this.sdk=e.sdk||"@siteline/js",this.sdkVersion=e.sdkVersion||"1.0.6",this.integrationType=e.integrationType||"js",this.debug&&console.log("[Siteline] Siteline initialized")}async track(e){const t=this.sanitize(e);try{return await this.send(t)}catch(e){this.debug&&console.error("[Siteline] Track failed:",e.message)}}sanitize(e){return{websiteKey:this.key,url:(e.url+"").slice(0,2048),method:(e.method+"").toUpperCase().slice(0,10),status:Math.max(0,Math.min(999,Number(e.status)||0)),duration:Math.max(0,Math.min(3e5,Number(e.duration)||0)),userAgent:e.userAgent?(e.userAgent+"").slice(0,512):null,ref:e.ref?(e.ref+"").slice(0,2048):null,ip:e.ip?(e.ip+"").slice(0,45):null,integrationType:this.integrationType.slice(0,50),sdk:this.sdk.slice(0,50),sdkVersion:this.sdkVersion.slice(0,20)}}async send(e){const t=new AbortController,i=setTimeout(()=>t.abort(),5e3);try{const i=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","User-Agent":`${this.sdk}/${this.sdkVersion}`},body:JSON.stringify(e),signal:t.signal});this.debug&&(i.ok?console.log("[Siteline] Tracked:",e.url,{endpoint:this.endpoint,sdk:this.sdk,sdkVersion:this.sdkVersion,integrationType:this.integrationType}):console.error("[Siteline] HTTP error:",i.status))}catch(e){this.debug&&console.error("[Siteline] Network error:",e.message)}finally{clearTimeout(i)}}}export{n as Siteline,e as SitelineError,i as SitelineTransportError,t as SitelineValidationError};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../src/errors.ts","../src/constants.ts","../src/siteline.ts"],"sourcesContent":[null,null,null],"names":["SitelineError","Error","constructor","message","super","this","name","SitelineValidationError","SitelineTransportError","WEBSITEKEY_PATTERN","Siteline","config","websiteKey","match","key","endpoint","debug","sdk","sdkVersion","integrationType","console","log","track","data","sanitized","sanitize","send","err","error","url","String","slice","method","toUpperCase","status","Math","max","min","Number","duration","userAgent","ref","ip","controller","AbortController","timeout","setTimeout","abort","res","fetch","headers","body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AAM,EDjDtC,KCiDyE,KAC5FU,IAAKlB,EAAKkB,KAAalB,EAAKkB,IAAZX,IAAiBC,MAAM,EDjD3B,MCiDuD,KACnEW,GAAInB,EAAKmB,IAAYnB,EAAKmB,GAAZZ,IAAgBC,MAAM,EDjDzB,ICiDoD,KAC/DZ,gBAAiBd,KAAKc,gBAAgBY,MAAM,EDjDnB,ICkDzBd,IAAKZ,KAAKY,IAAIc,MAAM,EDjDR,ICkDZb,WAAYb,KAAKa,WAAWa,MAAM,EDjDd,ICmDxB,CAEQ,UAAML,CAAKH,GACjB,MAAMoB,EAAa,IAAIC,gBACjBC,EAAUC,WAAW,IAAMH,EAAWI,QDhDtB,KCkDtB,IACE,MAAMC,QAAYC,MAAM5C,KAAKU,SAAU,CACrCiB,OAAQ,OACRkB,QAAS,CACP,eAAgB,mBAChB,aAAc,GAAG7C,KAAKY,OAAOZ,KAAKa,cAEpCiC,KAAMC,KAAKC,UAAU9B,GACrB+B,OAAQX,EAAWW,SAGjBjD,KAAKW,QACHgC,EAAIO,GACNnC,QAAQC,IAAI,sBAAuBE,EAAKM,IAAK,CAC3Cd,SAAUV,KAAKU,SACfE,IAAKZ,KAAKY,IACVC,WAAYb,KAAKa,WACjBC,gBAAiBd,KAAKc,kBAGxBC,QAAQQ,MAAM,yBAA0BoB,EAAId,QAGlD,CAAE,MAAOP,GACHtB,KAAKW,OAEPI,QAAQQ,MAAM,4BADAD,EACmCxB,QAErD,SACEqD,aAAaX,EACf,CACF"}
1
+ {"version":3,"file":"index.mjs","sources":["../src/errors.ts","../src/constants.ts","../src/siteline.ts"],"sourcesContent":[null,null,null],"names":["SitelineError","Error","constructor","message","super","this","name","SitelineValidationError","SitelineTransportError","WEBSITE_KEY_REGEX","Siteline","config","websiteKey","test","key","endpoint","debug","sdk","sdkVersion","integrationType","console","log","track","data","sanitized","sanitize","send","err","error","url","String","slice","method","toUpperCase","status","Math","max","min","Number","duration","userAgent","ref","ip","controller","AbortController","timeout","setTimeout","abort","res","f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CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAU;IAChC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAS;IAC7B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAS;gBAE7B,MAAM,EAAE,cAAc;IAmB5B,KAAK,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAa9C,OAAO,CAAC,QAAQ;YAgBF,IAAI;CAoCnB"}
1
+ {"version":3,"file":"siteline.d.ts","sourceRoot":"","sources":["../src/siteline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAY5D,qBAAa,QAAQ;IACnB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAS;IAC7B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAU;IAChC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAS;IAC7B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAS;gBAE7B,MAAM,EAAE,cAAc;IAoB5B,KAAK,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAa9C,OAAO,CAAC,QAAQ;YAgBF,IAAI;CAoCnB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@siteline/core",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "Core tracking SDK for Siteline - Agent Analytics platform for tracking AI agents, bots, and crawlers",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
@@ -21,6 +21,8 @@
21
21
  "build": "rollup -c && tsc --emitDeclarationOnly --declaration --declarationMap --outDir dist",
22
22
  "dev": "rollup -c -w",
23
23
  "clean": "rm -rf dist",
24
+ "lint": "eslint \"src/**/*.ts\"",
25
+ "lint:fix": "eslint \"src/**/*.ts\" --fix",
24
26
  "typecheck": "tsc --noEmit",
25
27
  "test": "jest",
26
28
  "test:watch": "jest --watch",
@@ -48,17 +50,17 @@
48
50
  "analytics",
49
51
  "monitoring"
50
52
  ],
51
- "author": "Siteline <support@siteline.ai> (https://siteline.ai)",
53
+ "author": "Siteline <team@siteline.ai> (https://siteline.ai)",
52
54
  "license": "MIT",
53
55
  "repository": {
54
56
  "type": "git",
55
- "url": "git+https://github.com/siteline-ai/siteline-sdk-js.git",
57
+ "url": "git+https://github.com/siteline-ai/siteline-js-sdk.git",
56
58
  "directory": "packages/core"
57
59
  },
58
60
  "bugs": {
59
- "url": "https://github.com/siteline-ai/siteline-sdk-js/issues"
61
+ "url": "https://github.com/siteline-ai/siteline-js-sdk/issues"
60
62
  },
61
- "homepage": "https://github.com/siteline-ai/siteline-sdk-js/tree/main/packages/core#readme",
63
+ "homepage": "https://github.com/siteline-ai/siteline-js-sdk/tree/main/packages/core#readme",
62
64
  "engines": {
63
65
  "node": ">=18.0.0"
64
66
  },
package/CHANGELOG.md DELETED
@@ -1,18 +0,0 @@
1
- # @siteline/core
2
-
3
- ## 1.0.1
4
-
5
- Initial release
6
-
7
- ### Features
8
-
9
- - Core Client tracking SDK
10
- - TypeScript support with full type definitions
11
- - Automatic data sanitization and validation
12
- - HTTPS-only enforcement
13
- - Edge runtime support (Cloudflare Workers, Vercel Edge, Deno)
14
- - Node.js 18+ support
15
- - Zero runtime dependencies
16
- - ~1.6KB minified + gzipped
17
- - Configurable endpoint and debug mode
18
- - 5-second request timeout protection