{"_id":"@attryio/sdk-core","_rev":"5-0a03ae7c690e4db066d316db01fc5df8","name":"@attryio/sdk-core","dist-tags":{"latest":"0.1.6"},"versions":{"0.1.0":{"name":"@attryio/sdk-core","version":"0.1.0","license":"Apache-2.0","_id":"@attryio/sdk-core@0.1.0","maintainers":[{"name":"mozhn","email":"mazlum@tuta.io"}],"dist":{"shasum":"a1a3c1a78cfef2347666310f2ba3c6fe353be2b0","tarball":"https://registry.npmjs.org/@attryio/sdk-core/-/sdk-core-0.1.0.tgz","fileCount":17,"integrity":"sha512-Tr2a5RbOlJIsXkS9n5FubTQ8if1Xz8OJnX9XiWx0dqbu3dx/l2NofZAbOSXkpKy5NSBnPwQTGEcSp8e6RXb8Qg==","signatures":[{"sig":"MEYCIQDHEIfPRGDEZ+R2fJbT0BPqK9Rr38KWU7Zwe0s0yweCXAIhAKlfj+gSqEdX/sYyTXlhzN1EnRATXNP9+WCgLFq87GSk","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":20216},"main":"./dist/index.js","type":"module","_from":"file:/tmp/attryio-packs/attryio-sdk-core-0.1.0.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"private":false,"scripts":{"lint":"eslint .","test":"vitest run","build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"mozhn","email":"mazlum@tuta.io"},"_resolved":"/tmp/attryio-packs/attryio-sdk-core-0.1.0.tgz","_integrity":"sha512-Tr2a5RbOlJIsXkS9n5FubTQ8if1Xz8OJnX9XiWx0dqbu3dx/l2NofZAbOSXkpKy5NSBnPwQTGEcSp8e6RXb8Qg==","_npmVersion":"11.12.1","description":"Shared Attry SDK client used by platform-specific packages.","directories":{},"_nodeVersion":"25.9.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/sdk-core_0.1.0_1778676995114_0.6155202122367243","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@attryio/sdk-core","version":"0.1.1","license":"Apache-2.0","_id":"@attryio/sdk-core@0.1.1","maintainers":[{"name":"mozhn","email":"mazlum@tuta.io"}],"dist":{"shasum":"b8008f92eb7dde8f6c2a2fa528002eb5d3c359ed","tarball":"https://registry.npmjs.org/@attryio/sdk-core/-/sdk-core-0.1.1.tgz","fileCount":17,"integrity":"sha512-XAoToOpA/BgZTJGyW9+QU1rTlYJQTdEin+v4BfUI17YjRmB5wsGm/6dyjN69TSfakRMKYcBv78/3ujAZzWnB9g==","signatures":[{"sig":"MEUCIQDzT/E99dhtYSUFWRoHQwwrinHIVvqmXlL/zWt0a9onpAIgNbXpflvDMcPLdgsB+hzXGq91evyVAb2Sta6sECAWWDg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":20217},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"976695a2e9192b3a5091d0652b3e6684beee4336","private":false,"scripts":{"lint":"eslint .","test":"vitest run","build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"mozhn","email":"mazlum@tuta.io"},"_npmVersion":"11.12.1","description":"Shared Attry SDK client used by platform-specific packages.","directories":{},"_nodeVersion":"25.9.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/sdk-core_0.1.1_1778709087660_0.2992823173880441","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@attryio/sdk-core","version":"0.1.3","license":"Apache-2.0","_id":"@attryio/sdk-core@0.1.3","maintainers":[{"name":"mozhn","email":"mazlum@tuta.io"}],"dist":{"shasum":"01841f5c304701fd94ce1e4ac2896950fb1c7e58","tarball":"https://registry.npmjs.org/@attryio/sdk-core/-/sdk-core-0.1.3.tgz","fileCount":20,"integrity":"sha512-ygIshK5zhcpCLzRgdC0VPExZySnAGFnOdxAFCWv2f/8YZyo9Jub9y3S+Aix3L31Y9q6gMIIA4kRIovXtIcA66Q==","signatures":[{"sig":"MEQCIE+kDQzy477rPoInuM4cEOCSNXie2C2FLx+GP3cscg+IAiAfAHZhYMQphEM6tXtocnYSMoGjKsosmZAp7inhO//9tw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":29849},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"976695a2e9192b3a5091d0652b3e6684beee4336","private":false,"scripts":{"lint":"eslint .","test":"vitest run","build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"mozhn","email":"mazlum@tuta.io"},"_npmVersion":"11.12.1","description":"Shared Attry SDK client used by platform-specific packages.","directories":{},"_nodeVersion":"25.9.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/sdk-core_0.1.3_1778882640561_0.86121920749673","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@attryio/sdk-core","version":"0.1.4","keywords":["attry","mobile analytics","mobile attribution","deep links","deferred deep links","app analytics","campaign analytics","revenue analytics","sdk"],"license":"Apache-2.0","_id":"@attryio/sdk-core@0.1.4","maintainers":[{"name":"mozhn","email":"mazlum@tuta.io"}],"homepage":"https://attry.io","bugs":{"url":"https://github.com/mozhn/attry.io/issues"},"dist":{"shasum":"3c5c550d16ffaa79d9ff8045e0cad53d46db7697","tarball":"https://registry.npmjs.org/@attryio/sdk-core/-/sdk-core-0.1.4.tgz","fileCount":20,"integrity":"sha512-n4qqH+qoZ4APSF8feTGs9pxSfzPodeGATdZVV17HJHuW/X59BWgNmbBlHfxih5c+pco2XOKgVxvy0TVxRes1Dw==","signatures":[{"sig":"MEUCIQCBlpeHjOaxKE+n4VHonIm5DAQGphJ2I5Nkx6h2goAQhQIgE2tKuR2e1aPJU9Zhb3jyiEvqxJmnVw7Q6FYF04NOGus=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":33045},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"976695a2e9192b3a5091d0652b3e6684beee4336","private":false,"scripts":{"lint":"eslint .","test":"vitest run","build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"mozhn","email":"mazlum@tuta.io"},"repository":{"url":"git+https://github.com/mozhn/attry.io.git","type":"git","directory":"packages/sdk-core"},"_npmVersion":"11.12.1","description":"Shared Attry SDK engine for mobile app analytics, attribution, deep links, deferred deep links, and revenue events.","directories":{},"_nodeVersion":"25.9.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/sdk-core_0.1.4_1779309525556_0.24223366787593448","host":"s3://npm-registry-packages-npm-production"}},"0.1.6":{"name":"@attryio/sdk-core","version":"0.1.6","description":"Shared Attry SDK engine for mobile app analytics, attribution, deep links, deferred deep links, and revenue events.","private":false,"license":"Apache-2.0","type":"module","homepage":"https://attry.io","repository":{"type":"git","url":"git+https://github.com/mozhn/attry.io.git","directory":"packages/sdk-core"},"bugs":{"url":"https://github.com/mozhn/attry.io/issues"},"keywords":["attry","mobile analytics","mobile attribution","deep links","deferred deep links","app analytics","campaign analytics","revenue analytics","sdk"],"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"publishConfig":{"access":"public"},"scripts":{"build":"tsc -p tsconfig.json","lint":"eslint .","test":"vitest run","typecheck":"tsc -p tsconfig.json --noEmit"},"_id":"@attryio/sdk-core@0.1.6","_integrity":"sha512-pfI1T/Pc0ZuABEBWY+vBks//X7TKfe2LwgSG5vm4KfZhqVDhLwQqiZfJfWxMfv22A6Qu98nEpgqaC5YHu6KdOA==","_resolved":"/tmp/attry-npm-pack/attryio-sdk-core-0.1.6.tgz","_from":"file:/tmp/attry-npm-pack/attryio-sdk-core-0.1.6.tgz","_nodeVersion":"25.9.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-pfI1T/Pc0ZuABEBWY+vBks//X7TKfe2LwgSG5vm4KfZhqVDhLwQqiZfJfWxMfv22A6Qu98nEpgqaC5YHu6KdOA==","shasum":"53b49fe7ed50e31024bf58ed8e5669515e5ef318","tarball":"https://registry.npmjs.org/@attryio/sdk-core/-/sdk-core-0.1.6.tgz","fileCount":20,"unpackedSize":34540,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHHLcAmMY7BXgdOK2oiQ2Jeu+MOFt94OqJvHspPgbvK/AiEAy9TfL5RJ3hL3tfd89q0JJMijogbyBDVTOgrfvJZaabs="}]},"_npmUser":{"name":"mozhn","email":"mazlum@tuta.io"},"directories":{},"maintainers":[{"name":"mozhn","email":"mazlum@tuta.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk-core_0.1.6_1779566601876_0.5196078220296529"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-13T12:56:35.009Z","modified":"2026-05-23T20:03:22.158Z","0.1.0":"2026-05-13T12:56:35.313Z","0.1.1":"2026-05-13T21:51:27.801Z","0.1.3":"2026-05-15T22:04:00.716Z","0.1.4":"2026-05-20T20:38:45.734Z","0.1.6":"2026-05-23T20:03:22.017Z"},"bugs":{"url":"https://github.com/mozhn/attry.io/issues"},"license":"Apache-2.0","homepage":"https://attry.io","keywords":["attry","mobile analytics","mobile attribution","deep links","deferred deep links","app analytics","campaign analytics","revenue analytics","sdk"],"repository":{"type":"git","url":"git+https://github.com/mozhn/attry.io.git","directory":"packages/sdk-core"},"description":"Shared Attry SDK engine for mobile app analytics, attribution, deep links, deferred deep links, and revenue events.","maintainers":[{"name":"mozhn","email":"mazlum@tuta.io"}],"readme":"# @attryio/sdk-core\n\nShared JavaScript engine for [Attry](https://attry.io), a mobile app analytics and attribution platform for campaign analytics, app user analytics, deep links, deferred deep links, and revenue events.\n\nMost mobile apps should **not** install this package directly. Use one of the platform SDKs instead:\n\n- React Native: [`@attryio/react-native`](https://www.npmjs.com/package/@attryio/react-native)\n- Capacitor: [`@attryio/capacitor`](https://www.npmjs.com/package/@attryio/capacitor)\n\n`@attryio/sdk-core` is the transport, queue, storage, event normalization, revenue normalization, and deep link resolution layer used by those platform SDKs. It is useful when you are building a custom Attry integration, a new platform SDK, or a server/runtime adapter.\n\n## Links\n\n- Website: [attry.io](https://attry.io)\n- Dashboard: [app.attry.io](https://app.attry.io)\n- Event tracking docs: [attry.io/resources/event-tracking](https://attry.io/resources/event-tracking)\n- Standard events: [attry.io/resources/standard-events](https://attry.io/resources/standard-events)\n- Domain setup: [attry.io/resources/domain-setup](https://attry.io/resources/domain-setup)\n\n## Install\n\n```sh\nnpm install @attryio/sdk-core\n```\n\nAgain: customer apps normally install `@attryio/react-native` or `@attryio/capacitor`. Core has no native lifecycle hooks, no native storage by default, and no platform-specific install attribution collection on its own.\n\n## Basic usage\n\n```ts\nimport { Attry } from \"@attryio/sdk-core\";\n\nconst attry = await new Attry({\n  appId: \"457064853\",\n  apiKey: \"attry_live_...\",\n  platform: \"ios\"\n}).init();\n\nawait attry.track(\"flashcards_generated\", {\n  properties: {\n    deckId: \"deck_123\",\n    cardCount: 18\n  }\n});\n```\n\n## Purchase intent and revenue\n\nUse `initiatePurchase` when the user starts a checkout, subscription, or paywall purchase flow.\n\n```ts\nawait attry.initiatePurchase({\n  properties: {\n    productId: \"pro_monthly\",\n    placement: \"paywall\"\n  }\n});\n```\n\nUse `purchase` when money was actually captured or a paid conversion happened. `purchase` must include `value` or `amountMinor` plus `currency`.\n\n```ts\nawait attry.purchase({\n  value: 31.42,\n  currency: \"USD\",\n  productId: \"pro_monthly\",\n  transactionId: \"txn_123\",\n  store: \"app_store\"\n});\n```\n\nAttry stores revenue as stable minor-unit fields, so campaign revenue is not guessed from arbitrary custom properties.\n\n## Standard events\n\nAttry accepts custom event names, but these standard names are reserved for dashboard reporting:\n\n| Event | Sent by | Purpose |\n| --- | --- | --- |\n| `install` | Platform SDK | First SDK install for the current app installation. |\n| `open` | Platform SDK | App opened or became active. |\n| `session_started` | Platform SDK | A new app usage session started. |\n| `session_ended` | Platform SDK | A session ended after backgrounding or timeout. |\n| `app_foreground` | Platform SDK | App returned to the foreground. |\n| `app_background` | Platform SDK | App moved to the background. |\n| `deep_link_opened` | Platform SDK | App opened from a deep link, universal link, or app link. |\n| `initiate_purchase` | App | User started a purchase or subscription flow. |\n| `purchase` | App | Paid conversion or purchase revenue. Requires revenue. |\n\nEverything else can be sent as a custom event with `track(\"your_event_name\", { properties })`.\n\n## What core provides\n\n- Event queueing and batch delivery to `https://api.attry.io/v1/events/batch`.\n- Stable installation and anonymous ID generation using the configured storage adapter.\n- `track`, `identify`, `initiatePurchase`, `purchase`, `resolveInstall`, `resolveDeepLink`, and `submitAppleAdsToken`.\n- Revenue validation for `purchase`.\n- URL parsing helpers for Attry links.\n- Storage and transport interfaces for platform SDKs.\n\n## Need help?\n\nEmail [hello@attry.io](mailto:hello@attry.io) or open the [Attry dashboard](https://app.attry.io).\n","readmeFilename":"README.md"}