ainamika-sdk 1.3.1 → 1.3.2

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.
Files changed (2) hide show
  1. package/README.md +88 -3
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -372,6 +372,92 @@ const analytics = new AInamikaSDK({
372
372
  });
373
373
  ```
374
374
 
375
+ ## Enterprise Self-Hosted Configuration
376
+
377
+ AInamika supports **Enterprise Self-Hosted deployments** for organizations that need to keep analytics data within their own infrastructure. When your organization has enterprise mode enabled, configure the SDK to point to your self-hosted instance:
378
+
379
+ ### Configuring for Enterprise Mode
380
+
381
+ ```javascript
382
+ const analytics = new AInamikaSDK({
383
+ projectKey: 'proj_xxxxxxxxxx',
384
+ projectSecret: 'your_secret_here',
385
+ autoConfig: true,
386
+
387
+ // Enterprise endpoint configuration
388
+ apiDetails: {
389
+ // Replace with your enterprise instance URL
390
+ apiEndPoint: 'https://your-enterprise-instance.com/api/v1/events',
391
+
392
+ // Optional: Add any custom headers required by your instance
393
+ headers: {
394
+ 'X-Enterprise-Token': 'your-enterprise-token'
395
+ }
396
+ }
397
+ });
398
+ ```
399
+
400
+ ### Enterprise Mode Features
401
+
402
+ When using enterprise mode:
403
+ - **Data Privacy**: All analytics data stays within your infrastructure
404
+ - **Custom Domains**: Use your own domain for SDK endpoints
405
+ - **Network Isolation**: Can work in air-gapped environments
406
+ - **Full Control**: Manage data retention, backups, and compliance
407
+
408
+ ### How to Get Your Enterprise Endpoint
409
+
410
+ 1. **From Dashboard**: If your admin has enabled enterprise mode, you'll see the endpoint URL in the project settings
411
+ 2. **From IT Team**: Your IT/DevOps team who deployed the enterprise instance will provide:
412
+ - The ingestion endpoint URL (e.g., `https://analytics.yourcompany.com/api/v1/events`)
413
+ - Any required authentication headers
414
+ 3. **Default Ports**:
415
+ - Ingestion API: Usually port 5000 or 8080
416
+ - Query API: Usually port 5001 or 8080
417
+
418
+ ### Example Configurations
419
+
420
+ **Docker Deployment:**
421
+ ```javascript
422
+ // For Docker deployments on local network
423
+ apiEndPoint: 'http://192.168.1.100:5000/api/v1/events'
424
+ ```
425
+
426
+ **Kubernetes with Ingress:**
427
+ ```javascript
428
+ // For K8s deployments with ingress
429
+ apiEndPoint: 'https://analytics.yourcompany.com/api/v1/events'
430
+ ```
431
+
432
+ **Behind VPN:**
433
+ ```javascript
434
+ // For instances behind corporate VPN
435
+ apiEndPoint: 'https://analytics.internal.company.net/api/v1/events'
436
+ ```
437
+
438
+ ### Verifying Enterprise Connection
439
+
440
+ To verify your SDK is correctly configured for enterprise:
441
+
442
+ 1. **Check Network Tab**: Events should go to your enterprise endpoint, not `api.ainamika.io`
443
+ 2. **Check Response**: Should return 200 OK with `{"success": true}`
444
+ 3. **Dashboard**: Login to AInamika dashboard - it will show "Enterprise Mode: Active" when enabled
445
+
446
+ ### Fallback Behavior
447
+
448
+ If enterprise endpoint is unreachable:
449
+ - Events are queued locally (up to `maxEventsInQueue` limit)
450
+ - SDK retries with exponential backoff
451
+ - No data is sent to AInamika cloud servers
452
+ - Events are eventually dropped if queue fills up
453
+
454
+ ### Security Considerations
455
+
456
+ - **HTTPS Required**: Always use HTTPS in production
457
+ - **Firewall Rules**: Ensure your app can reach the enterprise endpoint
458
+ - **Authentication**: Use the same `projectKey` and `projectSecret` as cloud mode
459
+ - **Network Policies**: May need to whitelist the enterprise instance in corporate networks
460
+
375
461
  ## Extra Config & Page Context
376
462
 
377
463
  Every event automatically includes **page context** (URL, path, query params, referrer) and any **extra config** you provide.
@@ -775,6 +861,5 @@ MIT License - see [LICENSE](LICENSE) for details.
775
861
 
776
862
  ## Support
777
863
 
778
- - Documentation: [https://ainamika.netlify.app/about.html](https://ainamika.netlify.app/about.html)
779
- - Issues: [https://github.com/adarshsingh/ainamika-sdk/issues](https://github.com/adarshsingh/ainamika-sdk/issues)
780
- - Email: adarshsingh061295@gmail.com
864
+ - Documentation: [https://ainamika.com/about.html](https://ainamika.com/about.html)
865
+ - Email: thefounder@ainamika.com
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ainamika-sdk",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "description": "AI-powered analytics SDK with Web Vitals, engagement tracking, error monitoring, and real-time insights for web applications",
5
5
  "main": "dist/ainamika-sdk.js",
6
6
  "types": "dist/sdk.d.ts",
@@ -45,7 +45,7 @@
45
45
  "type": "git",
46
46
  "url": "https://github.com/adarshsingh/ainamika-sdk.git"
47
47
  },
48
- "homepage": "https://ainamika.netlify.app/about.html",
48
+ "homepage": "https://ainamika.com/about.html",
49
49
  "bugs": {
50
50
  "url": "https://github.com/adarshsingh/ainamika-sdk/issues"
51
51
  },