{"_id":"x-ads-sdk","_rev":"6-21667a0c591a7fbcb20d601ec42c1e3b","name":"x-ads-sdk","dist-tags":{"latest":"1.0.5"},"versions":{"1.0.0":{"name":"x-ads-sdk","version":"1.0.0","keywords":["twitter","x","ads","api","typescript","oauth","analytics","campaigns","advertising"],"author":{"name":"kage1020"},"license":"MIT","_id":"x-ads-sdk@1.0.0","maintainers":[{"name":"kage1020","email":"4624528@ed.tus.ac.jp"}],"homepage":"https://github.com/kage1020/x-ads-sdk#readme","bugs":{"url":"https://github.com/kage1020/x-ads-sdk/issues"},"dist":{"shasum":"579aa25f77c37798217205d79558c27a05c32c1c","tarball":"https://registry.npmjs.org/x-ads-sdk/-/x-ads-sdk-1.0.0.tgz","fileCount":120,"integrity":"sha512-i2XJbSpt7eDdHFojgwJwnJNMnXT+qFBzGM6y3NX8E0+UkYGzw7cXyusDa+SVaGXJYqd8FM4B6Daa50pxQv+yUw==","signatures":[{"sig":"MEQCICQ+pYO6lnUxxT9eE0VOmKMdXRPYsaBRJE36ee5xvEctAiAuJflYFz960e5X7eAkOpplj12xmiQdtB1bsmX4PaKt0w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":411929},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=20.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./esm":{"types":"./dist/index.d.ts","import":"./dist/index.esm.js"},"./min":{"types":"./dist/index.d.ts","import":"./dist/index.esm.min.js"}},"gitHead":"d99b6146c878f0869dc5c15e035f7285d3d0ee10","scripts":{"dev":"vite","docs":"typedoc","lint":"eslint src/**/*.ts","test":"vitest --run","build":"npm run build:clean && npm run build:esm && npm run build:bundle","preview":"vite preview","lint:fix":"eslint src/**/*.ts --fix","build:esm":"tsc --project tsconfig.build.json","docs:json":"typedoc --json docs/api.json","docs:serve":"npm run docs && npx http-server docs -p 8080 -o","docs:watch":"typedoc --watch","test:watch":"vitest","build:clean":"rimraf dist","build:bundle":"rollup -c","build:analyze":"rollup -c --environment BUILD:analyze","docs:generate":"node scripts/generate-docs.js","docs:markdown":"typedoc --plugin typedoc-plugin-markdown --out docs-md","test:coverage":"vitest --coverage","bundle:analyze":"node scripts/analyze-bundle.js","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"kage1020","email":"4624528@ed.tus.ac.jp"},"repository":{"url":"git+https://github.com/kage1020/x-ads-sdk.git","type":"git"},"_npmVersion":"10.8.2","description":"Strongly typed, full-featured X (Twitter) Ads API client for Node.js","directories":{},"sideEffects":false,"_nodeVersion":"20.19.4","_hasShrinkwrap":false,"devDependencies":{"vite":"^5.2.0","tslib":"^2.8.1","eslint":"^8.57.1","rimraf":"^5.0.0","rollup":"^4.49.0","vitest":"^3.2.4","typedoc":"^0.28.0","typescript":"^5.2.2","@types/node":"^20.19.11","http-server":"^14.1.1","@vitest/coverage-v8":"^3.2.4","@rollup/plugin-terser":"^0.4.4","rollup-plugin-filesize":"^10.0.0","typedoc-plugin-markdown":"^4.8.1","@rollup/plugin-typescript":"^12.1.4","@typescript-eslint/parser":"^6.21.0","@rollup/plugin-node-resolve":"^16.0.1","@typescript-eslint/eslint-plugin":"^6.21.0"},"_npmOperationalInternal":{"tmp":"tmp/x-ads-sdk_1.0.0_1756542962699_0.1210348493335458","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"x-ads-sdk","version":"1.0.1","keywords":["twitter","x","ads","api","typescript","oauth","analytics","campaigns","advertising"],"author":{"name":"kage1020"},"license":"MIT","_id":"x-ads-sdk@1.0.1","maintainers":[{"name":"kage1020","email":"4624528@ed.tus.ac.jp"}],"homepage":"https://github.com/kage1020/x-ads-sdk#readme","bugs":{"url":"https://github.com/kage1020/x-ads-sdk/issues"},"dist":{"shasum":"dbdd9f9ddc82a049757f75aa69d4b1eb8c2ced83","tarball":"https://registry.npmjs.org/x-ads-sdk/-/x-ads-sdk-1.0.1.tgz","fileCount":135,"integrity":"sha512-qVG8N8beFx5QIq3C/mWwd5vJ66cWn7Bt5nRHPkfKJ5U42zpW/Hv9KWlGkV4PUvE5u5f6AQvPzIDuD8yhNdS1NA==","signatures":[{"sig":"MEQCIFhHP1l3/+GWHjVd3LJKkWvp3ijwlYncW+wOD3UCq+66AiAjKTCBBXGgSs8MkmSC8aeRDD5db/11mmMwlQC4qBFneA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":368870},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=20.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./esm":{"types":"./dist/index.d.ts","import":"./dist/index.esm.js"},"./min":{"types":"./dist/index.d.ts","import":"./dist/index.esm.min.js"}},"gitHead":"c946668361f1c3058bb74b82df70b41e2b466385","scripts":{"dev":"vite","docs":"typedoc","lint":"biome check src","test":"vitest --run","build":"npm run build:clean && npm run build:esm && npm run build:bundle","format":"biome format --write src","preview":"vite preview","lint:fix":"biome check --write src","build:esm":"tsc --project tsconfig.build.json","docs:json":"typedoc --json docs/api.json","docs:serve":"npm run docs && npx http-server docs -p 8080 -o","docs:watch":"typedoc --watch","test:watch":"vitest","build:clean":"rimraf dist","build:bundle":"rollup -c","docs:generate":"node scripts/generate-docs.js","test:coverage":"vitest --coverage","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"kage1020","email":"4624528@ed.tus.ac.jp"},"overrides":{"rollup":"^4.49.0"},"repository":{"url":"git+https://github.com/kage1020/x-ads-sdk.git","type":"git"},"_npmVersion":"10.8.2","description":"Strongly typed, full-featured X (Twitter) Ads API client for Node.js","directories":{},"sideEffects":false,"_nodeVersion":"20.19.4","_hasShrinkwrap":false,"devDependencies":{"vite":"^7.1.3","tslib":"^2.8.1","rimraf":"^6.0.1","rollup":"^4.49.0","vitest":"^3.2.4","typedoc":"^0.28.0","typescript":"^5.9.2","@types/node":"^24.3.0","http-server":"^14.1.1","@biomejs/biome":"^2.2.2","@vitest/coverage-v8":"^3.2.4","@rollup/plugin-terser":"^0.4.4","rollup-plugin-filesize":"^10.0.0","typedoc-plugin-markdown":"^4.8.1","@rollup/plugin-typescript":"^12.1.4","@rollup/plugin-node-resolve":"^16.0.1"},"optionalDependencies":{"@rollup/rollup-darwin-x64":"^4.49.0","@rollup/rollup-darwin-arm64":"^4.49.0","@rollup/rollup-linux-x64-gnu":"^4.49.0","@rollup/rollup-linux-x64-musl":"^4.49.0","@rollup/rollup-win32-x64-msvc":"^4.49.0","@rollup/rollup-win32-ia32-msvc":"^4.49.0","@rollup/rollup-win32-arm64-msvc":"^4.49.0"},"_npmOperationalInternal":{"tmp":"tmp/x-ads-sdk_1.0.1_1756642591161_0.042515255237953076","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"x-ads-sdk","version":"1.0.2","keywords":["twitter","x","ads","api","typescript","oauth","analytics","campaigns","advertising"],"author":{"name":"kage1020"},"license":"MIT","_id":"x-ads-sdk@1.0.2","maintainers":[{"name":"kage1020","email":"4624528@ed.tus.ac.jp"}],"homepage":"https://github.com/kage1020/x-ads-sdk#readme","bugs":{"url":"https://github.com/kage1020/x-ads-sdk/issues"},"dist":{"shasum":"8f958ff4f8357d34060a5eff043347b67f36b8d4","tarball":"https://registry.npmjs.org/x-ads-sdk/-/x-ads-sdk-1.0.2.tgz","fileCount":139,"integrity":"sha512-Bsii82b8rtZw5S5CUktwukquc7FsckQRnm0cZL2MDUXBzLIDJT2yhVMG+GBvepOI9Milp0l+pOBoc5M1Hdnm3w==","signatures":[{"sig":"MEYCIQDreWKk5aNv275sNI284vS3xBNqXMn7JTb8mT0Bcxj7qwIhAMkvSC4PPtciHsva5JwJOctpuli+j8K0BYEDNRn4MSjy","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":439907},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=20.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./esm":{"types":"./dist/index.d.ts","import":"./dist/index.esm.js"},"./min":{"types":"./dist/index.d.ts","import":"./dist/index.esm.min.js"}},"gitHead":"9b0917b34f90c2900d1f53db7c4a370e192f5498","scripts":{"dev":"vite","docs":"typedoc","lint":"biome check src","test":"vitest --run","build":"npm run build:clean && npm run build:esm && npm run build:bundle","format":"biome format --write src","preview":"vite preview","lint:fix":"biome check --write src","build:esm":"tsc --project tsconfig.build.json","docs:json":"typedoc --json docs/api.json","docs:serve":"npm run docs && npx http-server docs -p 8080 -o","docs:watch":"typedoc --watch","test:watch":"vitest","build:clean":"rimraf dist","build:bundle":"rollup -c","docs:generate":"node scripts/generate-docs.js","test:coverage":"vitest --run --coverage","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"kage1020","email":"4624528@ed.tus.ac.jp"},"overrides":{"rollup":"^4.49.0"},"repository":{"url":"git+https://github.com/kage1020/x-ads-sdk.git","type":"git"},"_npmVersion":"10.8.2","description":"Strongly typed, full-featured X (Twitter) Ads API client for Node.js","directories":{},"sideEffects":false,"_nodeVersion":"20.19.4","_hasShrinkwrap":false,"devDependencies":{"vite":"^7.1.3","tslib":"^2.8.1","rimraf":"^6.0.1","rollup":"^4.49.0","vitest":"^3.2.4","typedoc":"^0.28.0","typescript":"^5.9.2","@types/node":"^24.3.0","http-server":"^14.1.1","@biomejs/biome":"^2.2.2","@vitest/coverage-v8":"^3.2.4","@rollup/plugin-terser":"^0.4.4","rollup-plugin-filesize":"^10.0.0","typedoc-plugin-markdown":"^4.8.1","@rollup/plugin-typescript":"^12.1.4","@rollup/plugin-node-resolve":"^16.0.1"},"optionalDependencies":{"@rollup/rollup-darwin-x64":"^4.49.0","@rollup/rollup-darwin-arm64":"^4.49.0","@rollup/rollup-linux-x64-gnu":"^4.49.0","@rollup/rollup-linux-x64-musl":"^4.49.0","@rollup/rollup-win32-x64-msvc":"^4.49.0","@rollup/rollup-win32-ia32-msvc":"^4.49.0","@rollup/rollup-win32-arm64-msvc":"^4.49.0"},"_npmOperationalInternal":{"tmp":"tmp/x-ads-sdk_1.0.2_1756658062397_0.46029207939992633","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"x-ads-sdk","version":"1.0.3","keywords":["twitter","x","ads","api","typescript","oauth","analytics","campaigns","advertising"],"author":{"name":"kage1020"},"license":"MIT","_id":"x-ads-sdk@1.0.3","maintainers":[{"name":"kage1020","email":"4624528@ed.tus.ac.jp"}],"homepage":"https://github.com/kage1020/x-ads-sdk#readme","bugs":{"url":"https://github.com/kage1020/x-ads-sdk/issues"},"dist":{"shasum":"c0bfc71a320559b157e6b7f1a5916fad71d410e2","tarball":"https://registry.npmjs.org/x-ads-sdk/-/x-ads-sdk-1.0.3.tgz","fileCount":139,"integrity":"sha512-P4BkbK98Y5/J1Mlukm0mn8UvNzYSFQC5D4GaKD6RNQXLbPRkNwLDqpI9jPWIxqSWci3lYtU4g6Ic8pjQZx1/Ig==","signatures":[{"sig":"MEQCIDgSWcXkt7fuSe7B3se+6DHwKg2qGpqwX3Rk+cWPriWqAiAvthBCp4qljHOdkdNecOsAbmxdN5hscPi99wT17w2+3A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":440580},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=20.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./esm":{"types":"./dist/index.d.ts","import":"./dist/index.esm.js"},"./min":{"types":"./dist/index.d.ts","import":"./dist/index.esm.min.js"}},"gitHead":"e7adb6fdbce902e4e746e918468790dc08ad04a2","scripts":{"dev":"vite","docs":"typedoc","lint":"biome check src","test":"vitest --run","build":"npm run build:clean && npm run build:esm && npm run build:bundle","format":"biome format --write src","preview":"vite preview","lint:fix":"biome check --write src","build:esm":"tsc --project tsconfig.build.json","docs:json":"typedoc --json docs/api.json","docs:serve":"npm run docs && npx http-server docs -p 8080 -o","docs:watch":"typedoc --watch","test:watch":"vitest","build:clean":"rimraf dist","build:bundle":"rollup -c","docs:generate":"node scripts/generate-docs.js","test:coverage":"vitest --run --coverage","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"kage1020","email":"4624528@ed.tus.ac.jp"},"overrides":{"rollup":"^4.49.0"},"repository":{"url":"git+https://github.com/kage1020/x-ads-sdk.git","type":"git"},"_npmVersion":"10.8.2","description":"Strongly typed, full-featured X (Twitter) Ads API client for Node.js","directories":{},"sideEffects":false,"_nodeVersion":"20.19.4","_hasShrinkwrap":false,"devDependencies":{"vite":"^7.1.3","tslib":"^2.8.1","rimraf":"^6.0.1","rollup":"^4.49.0","vitest":"^3.2.4","typedoc":"^0.28.0","typescript":"^5.9.2","@types/node":"^24.3.0","http-server":"^14.1.1","@biomejs/biome":"^2.2.2","@vitest/coverage-v8":"^3.2.4","@rollup/plugin-terser":"^0.4.4","rollup-plugin-filesize":"^10.0.0","typedoc-plugin-markdown":"^4.8.1","@rollup/plugin-typescript":"^12.1.4","@rollup/plugin-node-resolve":"^16.0.1"},"optionalDependencies":{"@rollup/rollup-darwin-x64":"^4.49.0","@rollup/rollup-darwin-arm64":"^4.49.0","@rollup/rollup-linux-x64-gnu":"^4.49.0","@rollup/rollup-linux-x64-musl":"^4.49.0","@rollup/rollup-win32-x64-msvc":"^4.49.0","@rollup/rollup-win32-ia32-msvc":"^4.49.0","@rollup/rollup-win32-arm64-msvc":"^4.49.0"},"_npmOperationalInternal":{"tmp":"tmp/x-ads-sdk_1.0.3_1756686463007_0.34410938288351334","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"x-ads-sdk","version":"1.0.4","keywords":["twitter","x","ads","api","typescript","oauth","analytics","campaigns","advertising"],"author":{"name":"kage1020"},"license":"MIT","_id":"x-ads-sdk@1.0.4","maintainers":[{"name":"kage1020","email":"4624528@ed.tus.ac.jp"}],"homepage":"https://github.com/kage1020/x-ads-sdk#readme","bugs":{"url":"https://github.com/kage1020/x-ads-sdk/issues"},"dist":{"shasum":"ea6fc66738a1aa43b519dcec628395809aa1fd45","tarball":"https://registry.npmjs.org/x-ads-sdk/-/x-ads-sdk-1.0.4.tgz","fileCount":195,"integrity":"sha512-ea5X5MClPyu6AtGx8EHleQPezqWNg5h1i+zgOswwBe9RxlJ8MhuU5pQyxvd4fEsUEVkyOvs+Ie9ag2AQ6NiwIw==","signatures":[{"sig":"MEUCICbhlV6JCDUm+JHMFskl/LNW96NGtoM225kuJDwETmdHAiEAzd5uveSIi531jXqP/1ZxRT4hhGgdISrVhQO8gE3Hdxw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":795695},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=20.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./esm":{"types":"./dist/index.d.ts","import":"./dist/index.esm.js"},"./min":{"types":"./dist/index.d.ts","import":"./dist/index.esm.min.js"}},"gitHead":"abe1551fbfb7ebc079a0ad0897b0bfa5623d7798","scripts":{"dev":"vite","docs":"typedoc","lint":"biome check src","test":"vitest --run","build":"npm run build:clean && npm run build:esm && npm run build:bundle","format":"biome format --write src","preview":"vite preview","lint:fix":"biome check --write src","build:esm":"tsc --project tsconfig.build.json","docs:json":"typedoc --json docs/api.json","docs:serve":"npm run docs && npx http-server docs -p 8080 -o","docs:watch":"typedoc --watch","test:watch":"vitest","build:clean":"rimraf dist","build:bundle":"rollup -c","docs:generate":"node scripts/generate-docs.js","test:coverage":"vitest --run --coverage","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"kage1020","email":"4624528@ed.tus.ac.jp"},"overrides":{"rollup":"^4.49.0"},"repository":{"url":"git+https://github.com/kage1020/x-ads-sdk.git","type":"git"},"_npmVersion":"10.8.2","description":"Strongly typed, full-featured X (Twitter) Ads API client for Node.js","directories":{},"sideEffects":false,"_nodeVersion":"20.19.4","_hasShrinkwrap":false,"devDependencies":{"vite":"^7.1.3","tslib":"^2.8.1","rimraf":"^6.0.1","rollup":"^4.49.0","vitest":"^3.2.4","typedoc":"^0.28.0","typescript":"^5.9.2","@types/node":"^24.3.0","http-server":"^14.1.1","@biomejs/biome":"^2.2.2","@vitest/coverage-v8":"^3.2.4","@rollup/plugin-terser":"^0.4.4","rollup-plugin-filesize":"^10.0.0","typedoc-plugin-markdown":"^4.8.1","@rollup/plugin-typescript":"^12.1.4"},"optionalDependencies":{"@rollup/rollup-darwin-x64":"^4.49.0","@rollup/rollup-darwin-arm64":"^4.49.0","@rollup/rollup-linux-x64-gnu":"^4.49.0","@rollup/rollup-linux-x64-musl":"^4.49.0","@rollup/rollup-win32-x64-msvc":"^4.49.0","@rollup/rollup-win32-ia32-msvc":"^4.49.0","@rollup/rollup-win32-arm64-msvc":"^4.49.0"},"_npmOperationalInternal":{"tmp":"tmp/x-ads-sdk_1.0.4_1756910499980_0.9436456869727978","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"name":"x-ads-sdk","version":"1.0.5","description":"TypeScript SDK for X Ads API","type":"module","main":"dist/index.cjs","module":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"build":"vite build && tsc --emitDeclarationOnly --outDir dist","dev":"vite build --watch","test":"vitest --run","test:ui":"vitest --ui","test:coverage":"vitest --run --coverage","lint":"biome check .","lint:fix":"biome check . --fix","format":"biome format . --write"},"keywords":["x","twitter","ads","api","sdk","typescript","oauth"],"author":{"name":"kage1020"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/kage1020/x-ads-sdk.git"},"bugs":{"url":"https://github.com/kage1020/x-ads-sdk/issues"},"homepage":"https://github.com/kage1020/x-ads-sdk#readme","devDependencies":{"@biomejs/biome":"^2.2.2","@types/node":"^24.3.0","@vitest/coverage-v8":"^3.2.4","@vitest/ui":"^3.2.4","jsdom":"^26.1.0","msw":"^2.11.1","typescript":"^5.9.2","vite":"^7.1.2","vite-plugin-dts":"^4.5.4","vitest":"^3.2.4"},"engines":{"node":">=20.0.0"},"_id":"x-ads-sdk@1.0.5","gitHead":"45705a3f875d06fdf519e4f8523dfec4c6646ecf","_nodeVersion":"20.19.4","_npmVersion":"10.8.2","dist":{"integrity":"sha512-7iaTvecYUwOtGetBdU6cCWy7F1KY7+bhCPZJpyVnQFPUDIjIDGu25Wu5j2/kQUGQsbJP8wR6y7EPl2CwySUcbg==","shasum":"1fe95f96ebfaaad6332ab5a5b0822485b01cec7e","tarball":"https://registry.npmjs.org/x-ads-sdk/-/x-ads-sdk-1.0.5.tgz","fileCount":63,"unpackedSize":320758,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDxLpphvmnegTZn6UKOWDZ35M2QeB4LilJRGKgtkjiFuAiEA8h0x7J4oSHp1AeN++a/TcvXQpqEFF7Qd4+PU1WIgGRs="}]},"_npmUser":{"name":"kage1020","email":"4624528@ed.tus.ac.jp"},"directories":{},"maintainers":[{"name":"kage1020","email":"4624528@ed.tus.ac.jp"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/x-ads-sdk_1.0.5_1757029083794_0.7838227664788462"},"_hasShrinkwrap":false}},"time":{"created":"2025-08-30T08:36:02.568Z","modified":"2025-09-04T23:38:04.231Z","1.0.0":"2025-08-30T08:36:02.939Z","1.0.1":"2025-08-31T12:16:31.436Z","1.0.2":"2025-08-31T16:34:22.606Z","1.0.3":"2025-09-01T00:27:43.187Z","1.0.4":"2025-09-03T14:41:40.247Z","1.0.5":"2025-09-04T23:38:04.037Z"},"bugs":{"url":"https://github.com/kage1020/x-ads-sdk/issues"},"author":{"name":"kage1020"},"license":"MIT","homepage":"https://github.com/kage1020/x-ads-sdk#readme","keywords":["x","twitter","ads","api","sdk","typescript","oauth"],"repository":{"type":"git","url":"git+https://github.com/kage1020/x-ads-sdk.git"},"description":"TypeScript SDK for X Ads API","maintainers":[{"name":"kage1020","email":"4624528@ed.tus.ac.jp"}],"readme":"# X Ads SDK for TypeScript\n\nA TypeScript SDK for the X Ads API, providing type-safe access to advertising campaigns, analytics, media management, and more.\n\n[![NPM Version](https://img.shields.io/npm/v/x-ads-sdk.svg)](https://www.npmjs.com/package/x-ads-sdk)\n[![Bundle Size](https://img.shields.io/bundlephobia/minzip/x-ads-sdk.svg)](https://bundlephobia.com/package/x-ads-sdk)\n[![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue.svg)](https://www.typescriptlang.org/)\n[![License](https://img.shields.io/npm/l/x-ads-sdk.svg)](https://github.com/kage1020/x-ads-sdk/blob/main/LICENSE)\n[![Build Status](https://img.shields.io/github/actions/workflow/status/kage1020/x-ads-sdk/ci.yml?branch=main)](https://github.com/kage1020/x-ads-sdk/actions)\n[![Coverage](https://img.shields.io/codecov/c/github/kage1020/x-ads-sdk.svg)](https://codecov.io/gh/kage1020/x-ads-sdk)\n\n## Features\n\n- 🔒 **OAuth 1.0a Authentication** - Secure authentication with X Ads API\n- 📊 **Analytics & Reporting** - Comprehensive analytics with async job support\n- 🎯 **Campaign Management** - Create, update, and manage advertising campaigns\n- 📱 **Media Management** - Upload and manage media assets\n- 🎨 **Targeting Options** - Advanced audience targeting capabilities\n- 📈 **Rate Limiting** - Built-in rate limiting with exponential backoff\n- 🛡️ **Type Safety** - Full TypeScript support with comprehensive type definitions\n- 🌐 **Runtime Agnostic** - Works in browsers, Node.js, and edge environments\n- 🧪 **Well Tested** - Comprehensive test coverage with contract and integration tests\n\n## Installation\n\n```bash\nnpm install x-ads-sdk\n```\n\n## Quick Start\n\n```typescript\nimport { XAdsClient } from 'x-ads-sdk';\n\n// Initialize the client\nconst client = new XAdsClient({\n  credentials: {\n    consumerKey: 'your-consumer-key',\n    consumerSecret: 'your-consumer-secret',\n    accessToken: 'your-access-token',\n    accessTokenSecret: 'your-access-token-secret',\n  },\n  environment: 'sandbox', // or 'production'\n});\n\n// Get advertising accounts\nconst accounts = await client.accounts.list();\nconsole.log(`Found ${accounts.data.length} accounts`);\n\n// Create a campaign\nconst campaign = await client.campaigns.create(accounts.data[0].id, {\n  name: 'My First Campaign',\n  funding_instrument_id: 'funding-instrument-id',\n  entity_status: 'PAUSED',\n  objective: 'AWARENESS',\n  start_time: new Date(Date.now() + 24 * 60 * 60 * 1000).toISOString(),\n  daily_budget_amount_local_micro: 10000000, // $10 in micro currency\n});\n\n// Get campaign analytics\nconst analytics = await client.analytics.getStats(accounts.data[0].id, {\n  entity: 'CAMPAIGN',\n  entity_ids: [campaign.data.id],\n  start_time: '2024-01-01T00:00:00Z',\n  end_time: '2024-01-07T00:00:00Z',\n  granularity: 'DAY',\n  placement: 'ALL_ON_TWITTER',\n  metrics: ['impressions', 'clicks', 'spend_micro'],\n});\n```\n\n## API Reference\n\n### Client Initialization\n\n```typescript\nconst client = new XAdsClient({\n  credentials: {\n    consumerKey: string;\n    consumerSecret: string;\n    accessToken: string;\n    accessTokenSecret: string;\n  },\n  environment: 'sandbox' | 'production';\n  timeout?: number; // Request timeout in ms (default: 60000)\n  debug?: boolean; // Enable debug logging (default: false)\n  rateLimitBuffer?: number; // Rate limit buffer (0-1, default: 0.1)\n});\n```\n\n### Available Resources\n\n#### Accounts\n\n```typescript\n// List advertising accounts\nconst accounts = await client.accounts.list();\n\n// Get specific account\nconst account = await client.accounts.get(accountId);\n```\n\n#### Campaigns\n\n```typescript\n// List campaigns\nconst campaigns = await client.campaigns.list(accountId, {\n  count: 10,\n  entity_statuses: ['ACTIVE', 'PAUSED'],\n});\n\n// Create campaign\nconst campaign = await client.campaigns.create(accountId, {\n  name: 'Campaign Name',\n  funding_instrument_id: 'funding-id',\n  objective: 'AWARENESS',\n  // ... other campaign data\n});\n\n// Update campaign\nconst updatedCampaign = await client.campaigns.update(accountId, campaignId, {\n  name: 'Updated Name',\n  entity_status: 'ACTIVE',\n});\n\n// Get campaign details\nconst campaign = await client.campaigns.getCampaign(accountId, campaignId);\n\n// Delete campaign\nawait client.campaigns.delete(accountId, campaignId);\n```\n\n#### Line Items\n\n```typescript\n// List line items\nconst lineItems = await client.lineItems.list(accountId, {\n  campaign_ids: ['campaign-id'],\n});\n\n// Create line item\nconst lineItem = await client.lineItems.create(accountId, {\n  name: 'Line Item Name',\n  campaign_id: 'campaign-id',\n  objective: 'AWARENESS',\n  product_type: 'PROMOTED_TWEETS',\n  // ... other line item data\n});\n```\n\n#### Analytics\n\n```typescript\n// Get synchronous analytics (small date ranges)\nconst analytics = await client.analytics.getStats(accountId, {\n  entity: 'CAMPAIGN',\n  entity_ids: ['campaign-id'],\n  start_time: '2024-01-01T00:00:00Z',\n  end_time: '2024-01-07T00:00:00Z',\n  granularity: 'DAY',\n  placement: 'ALL_ON_TWITTER',\n  metrics: ['impressions', 'clicks', 'spend_micro'],\n});\n\n// Create asynchronous analytics job (large date ranges)\nconst job = await client.analytics.createJob(accountId, {\n  entity: 'CAMPAIGN',\n  entity_ids: ['campaign-id'],\n  start_time: '2024-01-01T00:00:00Z',\n  end_time: '2024-03-31T00:00:00Z',\n  granularity: 'DAY',\n  placement: 'ALL_ON_TWITTER',\n  metrics: ['impressions', 'clicks', 'spend_micro'],\n});\n\n// Check job status\nconst jobStatus = await client.analytics.getJob(accountId, job.data.job_id);\n\n// List recent jobs\nconst jobs = await client.analytics.listJobs(accountId, { count: 10 });\n```\n\n#### Media\n\n```typescript\n// Upload media\nconst media = await client.media.upload(accountId, {\n  file: fileData, // File object or Blob\n  media_category: 'TWEET_IMAGE',\n  name: 'My Creative Asset',\n});\n\n// List media library\nconst mediaList = await client.media.list(accountId, {\n  media_category: 'TWEET_IMAGE',\n  count: 20,\n});\n\n// Get media details\nconst mediaDetails = await client.media.getMedia(accountId, mediaId);\n\n// Delete media\nawait client.media.delete(accountId, mediaId);\n```\n\n#### Targeting\n\n```typescript\n// Get targeting criteria\nconst locations = await client.targeting.getLocations('US');\nconst interests = await client.targeting.getInterests('technology');\nconst behaviors = await client.targeting.getBehaviors();\n```\n\n### Rate Limiting\n\nThe SDK includes built-in rate limiting with exponential backoff:\n\n```typescript\n// Check current rate limit status\nconst status = client.getRateLimitStatus();\nconsole.log(`Remaining requests: ${status.remaining}`);\n\n// Reset rate limiter (if needed)\nclient.resetRateLimit();\n```\n\n### Error Handling\n\n```typescript\ntry {\n  const campaigns = await client.campaigns.list(accountId);\n} catch (error) {\n  if (error instanceof Error) {\n    console.error('API Error:', error.message);\n\n    // Handle specific error types\n    if (error.message.includes('rate limit')) {\n      // Handle rate limiting\n    } else if (error.message.includes('unauthorized')) {\n      // Handle authentication errors\n    }\n  }\n}\n```\n\n## Authentication\n\nTo use the X Ads API, you need to:\n\n1. Create a Twitter/X Developer App\n2. Apply for Ads API access\n3. Generate OAuth 1.0a credentials\n\n### Environment Variables\n\nFor security, use environment variables for credentials:\n\n```bash\n# For Vite projects (browser)\nVITE_CONSUMER_KEY=your-consumer-key\nVITE_CONSUMER_SECRET=your-consumer-secret\nVITE_ACCESS_TOKEN=your-access-token\nVITE_ACCESS_TOKEN_SECRET=your-access-token-secret\n\n# For Node.js projects\nCONSUMER_KEY=your-consumer-key\nCONSUMER_SECRET=your-consumer-secret\nACCESS_TOKEN=your-access-token\nACCESS_TOKEN_SECRET=your-access-token-secret\n```\n\n## Examples\n\nComprehensive examples are available in the [`examples/`](./examples/) directory:\n\n- [Basic Usage](./examples/01-basic-usage.ts) - SDK initialization and basic operations\n- [Campaign Management](./examples/02-campaign-management.ts) - Creating and managing campaigns\n- [Analytics](./examples/03-analytics.ts) - Retrieving analytics data and managing jobs\n- [Media Upload](./examples/04-media-upload.ts) - Uploading and managing media assets\n\n### Running Examples\n\n```bash\n# Install dependencies\nnpm install\n\n# Run specific example\nnpx ts-node examples/01-basic-usage.ts\n\n# Or use the example scripts\nnpm run example:basic\nnpm run example:campaigns\nnpm run example:analytics\nnpm run example:media\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🔗 Resources\n\n- [X Ads API Documentation](https://docs.x.com/x-ads-api/introduction)\n- [X Developer Platform](https://developer.x.com/en/docs/x-ads-api)\n- [X Ads Python SDK](https://github.com/twitterdev/twitter-python-ads-sdk)\n- [X TypeScript SDK](https://github.com/xdevplatform/twitter-api-typescript-sdk)\n\n---\n\n**Note**: This SDK is not officially endorsed by X. It's a community-driven project to help developers integrate with the X Ads API more easily.\n","readmeFilename":"README.md"}