From c3ed58d0ab3ae33bdfd0c3c315eb84803175c80f Mon Sep 17 00:00:00 2001 From: Polliog Date: Sun, 8 Feb 2026 00:52:42 +0100 Subject: [PATCH 1/5] chore: update pnpm-lock.yaml with new dependencies for express and fastify packages --- .github/workflows/publish.yml | 14 ++ pnpm-lock.yaml | 319 ++++++++++++++++++++++++++++++++++ 2 files changed, 333 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 785211a..467fc45 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -174,6 +174,18 @@ jobs: env: NODE_AUTH_TOKEN: ${{ secrets.NPM_SECRET }} + - name: Publish @logtide/express + working-directory: packages/express + run: pnpm publish --no-git-checks --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_SECRET }} + + - name: Publish @logtide/fastify + working-directory: packages/fastify + run: pnpm publish --no-git-checks --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_SECRET }} + - name: Publish @logtide/nextjs working-directory: packages/nextjs run: pnpm publish --no-git-checks --access public @@ -222,6 +234,8 @@ jobs: echo "| @logtide/types | \`npm i @logtide/types@${VERSION}\` |" >> $GITHUB_STEP_SUMMARY echo "| @logtide/core | \`npm i @logtide/core@${VERSION}\` |" >> $GITHUB_STEP_SUMMARY echo "| @logtide/sdk-node | \`npm i @logtide/sdk-node@${VERSION}\` |" >> $GITHUB_STEP_SUMMARY + echo "| @logtide/express | \`npm i @logtide/express@${VERSION}\` |" >> $GITHUB_STEP_SUMMARY + echo "| @logtide/fastify | \`npm i @logtide/fastify@${VERSION}\` |" >> $GITHUB_STEP_SUMMARY echo "| @logtide/nextjs | \`npm i @logtide/nextjs@${VERSION}\` |" >> $GITHUB_STEP_SUMMARY echo "| @logtide/nuxt | \`npm i @logtide/nuxt@${VERSION}\` |" >> $GITHUB_STEP_SUMMARY echo "| @logtide/sveltekit | \`npm i @logtide/sveltekit@${VERSION}\` |" >> $GITHUB_STEP_SUMMARY diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b381da4..d8475fc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -75,6 +75,50 @@ importers: specifier: ^5.5.4 version: 5.9.3 + packages/express: + dependencies: + '@logtide/core': + specifier: workspace:* + version: link:../core + '@logtide/types': + specifier: workspace:* + version: link:../types + devDependencies: + '@types/express': + specifier: ^5.0.0 + version: 5.0.6 + express: + specifier: ^4.21.0 + version: 4.22.1 + tsup: + specifier: ^8.5.1 + version: 8.5.1(jiti@2.6.1)(postcss@8.5.6)(typescript@5.9.3)(yaml@2.8.2) + typescript: + specifier: ^5.5.4 + version: 5.9.3 + + packages/fastify: + dependencies: + '@logtide/core': + specifier: workspace:* + version: link:../core + '@logtide/types': + specifier: workspace:* + version: link:../types + devDependencies: + fastify: + specifier: ^5.2.0 + version: 5.7.4 + fastify-plugin: + specifier: ^5.0.0 + version: 5.1.0 + tsup: + specifier: ^8.5.1 + version: 8.5.1(jiti@2.6.1)(postcss@8.5.6)(typescript@5.9.3)(yaml@2.8.2) + typescript: + specifier: ^5.5.4 + version: 5.9.3 + packages/hono: dependencies: '@logtide/core': @@ -1773,9 +1817,15 @@ packages: '@types/express-serve-static-core@4.19.8': resolution: {integrity: sha512-02S5fmqeoKzVZCHPZid4b8JH2eM5HzQLZWN2FohQEy/0eXTq8VXZfSN6Pcr3F6N9R/vNrj7cpgbhjie6m/1tCA==} + '@types/express-serve-static-core@5.1.1': + resolution: {integrity: sha512-v4zIMr/cX7/d2BpAEX3KNKL/JrT1s43s96lLvvdTmza1oEvDudCqK9aF/djc/SWgy8Yh0h30TZx5VpzqFCxk5A==} + '@types/express@4.17.25': resolution: {integrity: sha512-dVd04UKsfpINUnK0yBoYHDF3xu7xVH4BuDotC/xGuycx4CgbP48X/KF/586bcObxT0HENHXEU8Nqtu6NR+eKhw==} + '@types/express@5.0.6': + resolution: {integrity: sha512-sKYVuV7Sv9fbPIt/442koC7+IIwK5olP1KWeD88e/idgoJqDm3JV/YUiPwkoKK92ylff2MGxSz1CSjsXelx0YA==} + '@types/http-errors@2.0.5': resolution: {integrity: sha512-r8Tayk8HJnX0FztbZN7oVqGccWgw98T/0neJphO91KkmOzug1KkofZURD4UaD5uH8AqcFLfdPErnBod0u71/qg==} @@ -1813,6 +1863,9 @@ packages: '@types/serve-static@1.15.10': resolution: {integrity: sha512-tRs1dB+g8Itk72rlSI2ZrW6vZg0YrLI81iQSTkMmOqnqCaNr/8Ek4VwWcN5vZgCYWbg/JJSGBlUaYGAOP73qBw==} + '@types/serve-static@2.2.0': + resolution: {integrity: sha512-8mam4H1NHLtu7nmtalF7eyBH14QyOASmcxHhSfEoRyr0nP/YdoesEtU+uSRvMe96TW/HPTtkoKqQLl53N7UXMQ==} + '@unhead/vue@2.1.3': resolution: {integrity: sha512-Cx0SvCPPOowHteJTpsI+sAQovYnmOgMdueL/McLIYyzJcSM1RBiB+4GJSWOvPDNBSK80SkyI654iWoW5V4UTTw==} peerDependencies: @@ -1969,6 +2022,10 @@ packages: abstract-logging@2.0.1: resolution: {integrity: sha512-2BjRTZxTPvheOvGbBslFSYOUkr+SjPtOnrLP33f+VIWLzezQpZcqVg7ja3L4dBXmzzgwT+a029jRx5PCi3JuiA==} + accepts@1.3.8: + resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==} + engines: {node: '>= 0.6'} + accepts@2.0.0: resolution: {integrity: sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==} engines: {node: '>= 0.6'} @@ -2048,6 +2105,9 @@ packages: resolution: {integrity: sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==} engines: {node: '>= 0.4'} + array-flatten@1.1.1: + resolution: {integrity: sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==} + assertion-error@1.1.0: resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==} @@ -2119,6 +2179,10 @@ packages: birpc@2.9.0: resolution: {integrity: sha512-KrayHS5pBi69Xi9JmvoqrIgYGDkD6mcSe/i6YKi3w5kekCLzrX4+nawcXqrj2tIp50Kw/mT/s3p+GVK0A0sKxw==} + body-parser@1.20.4: + resolution: {integrity: sha512-ZTgYYLMOXY9qKU/57FAo8F+HA2dGX7bqGc71txDRC1rS4frdFI5R7NhluHxH6M0YItAP0sHB4uqAOcYKxO6uGA==} + engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} + body-parser@2.2.2: resolution: {integrity: sha512-oP5VkATKlNwcgvxi0vM0p/D3n2C3EReYVX+DNYs5TjZFn/oQt2j+4sVJtSMr18pdRr8wjTcBl6LoV+FUwzPmNA==} engines: {node: '>=18'} @@ -2281,6 +2345,10 @@ packages: resolution: {integrity: sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==} engines: {node: ^14.18.0 || >=16.10.0} + content-disposition@0.5.4: + resolution: {integrity: sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==} + engines: {node: '>= 0.6'} + content-disposition@1.0.1: resolution: {integrity: sha512-oIXISMynqSqm241k6kcQ5UwttDILMK4BiurCfGEREw6+X9jkkpEe5T9FZaApyLGGOnFuyMWZpdolTXMtvEJ08Q==} engines: {node: '>=18'} @@ -2298,6 +2366,9 @@ packages: cookie-es@2.0.0: resolution: {integrity: sha512-RAj4E421UYRgqokKUmotqAwuplYw15qtdXfY+hGzgCJ/MBjCVZcSoHK/kH9kocfjRjcDME7IiDWR/1WX1TM2Pg==} + cookie-signature@1.0.7: + resolution: {integrity: sha512-NXdYc3dLr47pBkpUCHtKSwIOQXLVn8dZEuywboCOJY/osA0wFSLlSawr3KN8qXJEyX66FcONTH8EIlVuK0yyFA==} + cookie-signature@1.2.2: resolution: {integrity: sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==} engines: {node: '>=6.6.0'} @@ -2418,6 +2489,14 @@ packages: sqlite3: optional: true + debug@2.6.9: + resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + debug@4.4.3: resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} engines: {node: '>=6.0'} @@ -2473,6 +2552,10 @@ packages: destr@2.0.5: resolution: {integrity: sha512-ugFTXCtDZunbzasqBxrK93Ik/DRYsO6S/fedkWEMKqt04xZ4csmnmwGDBAb07QWNaGMAmnTIemsYZCksjATwsA==} + destroy@1.2.0: + resolution: {integrity: sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==} + engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} + detect-libc@2.1.2: resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} engines: {node: '>=8'} @@ -2654,6 +2737,10 @@ packages: resolution: {integrity: sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA==} engines: {node: '>=12.0.0'} + express@4.22.1: + resolution: {integrity: sha512-F2X8g9P1X7uCPZMA3MVf9wcTqlyNp7IhH5qPCI0izhaOIYXaW9L535tGA3qmjRzpH+bZczqq7hVKxTR4NWnu+g==} + engines: {node: '>= 0.10.0'} + express@5.2.1: resolution: {integrity: sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==} engines: {node: '>= 18'} @@ -2692,6 +2779,9 @@ packages: fastify-plugin@4.5.1: resolution: {integrity: sha512-stRHYGeuqpEZTL1Ef0Ovr2ltazUT9g844X5z/zEBFLG8RYlpDiOCIG+ATvYEp+/zmc7sN29mcIMp8gvYplYPIQ==} + fastify-plugin@5.1.0: + resolution: {integrity: sha512-FAIDA8eovSt5qcDgcBvDuX/v0Cjz0ohGhENZ/wpc3y+oZCY2afZ9Baqql3g/lC+OHRnciQol4ww7tuthOb9idw==} + fastify@5.7.4: resolution: {integrity: sha512-e6l5NsRdaEP8rdD8VR0ErJASeyaRbzXYpmkrpr2SuvuMq6Si3lvsaVy5C+7gLanEkvjpMDzBXWE5HPeb/hgTxA==} @@ -2718,6 +2808,10 @@ packages: resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} engines: {node: '>=8'} + finalhandler@1.3.2: + resolution: {integrity: sha512-aA4RyPcd3badbdABGDuTXCMTtOneUCAYH/gxoYRTZlIJdF0YPWuGqiAsIrhNnnqdXGswYk6dGujem4w80UJFhg==} + engines: {node: '>= 0.8'} + finalhandler@2.1.1: resolution: {integrity: sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==} engines: {node: '>= 18.0.0'} @@ -2740,6 +2834,10 @@ packages: fraction.js@5.3.4: resolution: {integrity: sha512-1X1NTtiJphryn/uLQz3whtY6jK3fTqoE3ohKs0tT+Ujr1W59oopxmoEh7Lu5p6vBaPbgoM0bzveAW4Qi5RyWDQ==} + fresh@0.5.2: + resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==} + engines: {node: '>= 0.6'} + fresh@2.0.0: resolution: {integrity: sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==} engines: {node: '>= 0.8'} @@ -3148,6 +3246,10 @@ packages: mdn-data@2.12.2: resolution: {integrity: sha512-IEn+pegP1aManZuckezWCO+XZQDplx1366JoVhTpMpBB1sPey/SbveZQUosKiKiGYjg1wH4pMlNgXbCiYgihQA==} + media-typer@0.3.0: + resolution: {integrity: sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==} + engines: {node: '>= 0.6'} + media-typer@1.1.0: resolution: {integrity: sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==} engines: {node: '>= 0.8'} @@ -3155,6 +3257,9 @@ packages: memoirist@0.4.0: resolution: {integrity: sha512-zxTgA0mSYELa66DimuNQDvyLq36AwDlTuVRbnQtB+VuTcKWm5Qc4z3WkSpgsFWHNhexqkIooqpv4hdcqrX5Nmg==} + merge-descriptors@1.0.3: + resolution: {integrity: sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==} + merge-descriptors@2.0.0: resolution: {integrity: sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==} engines: {node: '>=18'} @@ -3166,18 +3271,35 @@ packages: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} + methods@1.1.2: + resolution: {integrity: sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==} + engines: {node: '>= 0.6'} + micromatch@4.0.8: resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} engines: {node: '>=8.6'} + mime-db@1.52.0: + resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} + engines: {node: '>= 0.6'} + mime-db@1.54.0: resolution: {integrity: sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==} engines: {node: '>= 0.6'} + mime-types@2.1.35: + resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} + engines: {node: '>= 0.6'} + mime-types@3.0.2: resolution: {integrity: sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==} engines: {node: '>=18'} + mime@1.6.0: + resolution: {integrity: sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==} + engines: {node: '>=4'} + hasBin: true + mime@4.1.0: resolution: {integrity: sha512-X5ju04+cAzsojXKes0B/S4tcYtFAJ6tTMuSPBEn9CPGlrWr8Fiw7qYeLT0XyH80HSoAoqWCaz+MWKh22P7G1cw==} engines: {node: '>=16'} @@ -3224,6 +3346,9 @@ packages: resolution: {integrity: sha512-Y3wQdFg2Va6etvQ5I82yUhGdsKrcYox6p7FfL1LbK2J4V01F9TGlepTIhnK24t7koZibmg82KGglhA1XK5IsLQ==} engines: {node: '>=10'} + ms@2.0.0: + resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} + ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} @@ -3246,6 +3371,10 @@ packages: nanotar@0.2.0: resolution: {integrity: sha512-9ca1h0Xjvo9bEkE4UOxgAzLV0jHKe6LMaxo37ND2DAhhAtd0j8pR1Wxz+/goMrZO8AEZTWCmyaOsFI/W5AdpCQ==} + negotiator@0.6.3: + resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==} + engines: {node: '>= 0.6'} + negotiator@1.0.0: resolution: {integrity: sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==} engines: {node: '>= 0.6'} @@ -3455,6 +3584,9 @@ packages: resolution: {integrity: sha512-oWyT4gICAu+kaA7QWk/jvCHWarMKNs6pXOGWKDTr7cw4IGcUbW+PeTfbaQiLGheFRpjo6O9J0PmyMfQPjH71oA==} engines: {node: 20 || >=22} + path-to-regexp@0.1.12: + resolution: {integrity: sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==} + path-to-regexp@8.3.0: resolution: {integrity: sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA==} @@ -3755,6 +3887,10 @@ packages: resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==} engines: {node: '>= 0.6'} + raw-body@2.5.3: + resolution: {integrity: sha512-s4VSOf6yN0rvbRZGxs8Om5CWj6seneMwK3oDb4lWDH0UPhWcxwOWw5+qk24bxq87szX1ydrwylIOp2uG1ojUpA==} + engines: {node: '>= 0.8'} + raw-body@3.0.2: resolution: {integrity: sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==} engines: {node: '>= 0.10'} @@ -3913,6 +4049,10 @@ packages: engines: {node: '>=10'} hasBin: true + send@0.19.2: + resolution: {integrity: sha512-VMbMxbDeehAxpOtWJXlcUS5E8iXh6QmN+BkRX1GARS3wRaXEEgzCcB10gTQazO42tpNIya8xIyNx8fll1OFPrg==} + engines: {node: '>= 0.8.0'} + send@1.2.1: resolution: {integrity: sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==} engines: {node: '>= 18'} @@ -3927,6 +4067,10 @@ packages: serve-placeholder@2.0.2: resolution: {integrity: sha512-/TMG8SboeiQbZJWRlfTCqMs2DD3SZgWp0kDQePz9yUuCnDfDh/92gf7/PxGhzXTKBIPASIHxFcZndoNbp6QOLQ==} + serve-static@1.16.3: + resolution: {integrity: sha512-x0RTqQel6g5SY7Lg6ZreMmsOzncHFU7nhnRWkKgWuMTu5NN0DR5oruckMqRvacAN9d5w6ARnRBXl9xhDCgfMeA==} + engines: {node: '>= 0.8.0'} + serve-static@2.2.1: resolution: {integrity: sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==} engines: {node: '>= 18'} @@ -4262,6 +4406,10 @@ packages: resolution: {integrity: sha512-AXSAQJu79WGc79/3e9/CR77I/KQgeY1AhNvcShIH4PTcGYyC4xv6H4R4AUOwkPS5799KlVDAu8zExeCrkGquiA==} engines: {node: '>=20'} + type-is@1.6.18: + resolution: {integrity: sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==} + engines: {node: '>= 0.6'} + type-is@2.0.1: resolution: {integrity: sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==} engines: {node: '>= 0.6'} @@ -4421,6 +4569,10 @@ packages: util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} + utils-merge@1.0.1: + resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==} + engines: {node: '>= 0.4.0'} + vary@1.1.2: resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} engines: {node: '>= 0.8'} @@ -6182,6 +6334,13 @@ snapshots: '@types/range-parser': 1.2.7 '@types/send': 1.2.1 + '@types/express-serve-static-core@5.1.1': + dependencies: + '@types/node': 20.19.32 + '@types/qs': 6.14.0 + '@types/range-parser': 1.2.7 + '@types/send': 1.2.1 + '@types/express@4.17.25': dependencies: '@types/body-parser': 1.19.6 @@ -6189,6 +6348,12 @@ snapshots: '@types/qs': 6.14.0 '@types/serve-static': 1.15.10 + '@types/express@5.0.6': + dependencies: + '@types/body-parser': 1.19.6 + '@types/express-serve-static-core': 5.1.1 + '@types/serve-static': 2.2.0 + '@types/http-errors@2.0.5': {} '@types/mime@1.3.5': {} @@ -6229,6 +6394,11 @@ snapshots: '@types/node': 20.19.32 '@types/send': 0.17.6 + '@types/serve-static@2.2.0': + dependencies: + '@types/http-errors': 2.0.5 + '@types/node': 20.19.32 + '@unhead/vue@2.1.3(vue@3.5.27(typescript@5.9.3))': dependencies: hookable: 6.0.1 @@ -6488,6 +6658,11 @@ snapshots: abstract-logging@2.0.1: {} + accepts@1.3.8: + dependencies: + mime-types: 2.1.35 + negotiator: 0.6.3 + accepts@2.0.0: dependencies: mime-types: 3.0.2 @@ -6564,6 +6739,8 @@ snapshots: aria-query@5.3.2: {} + array-flatten@1.1.1: {} + assertion-error@1.1.0: {} assertion-error@2.0.1: {} @@ -6616,6 +6793,23 @@ snapshots: birpc@2.9.0: {} + body-parser@1.20.4: + dependencies: + bytes: 3.1.2 + content-type: 1.0.5 + debug: 2.6.9 + depd: 2.0.0 + destroy: 1.2.0 + http-errors: 2.0.1 + iconv-lite: 0.4.24 + on-finished: 2.4.1 + qs: 6.14.1 + raw-body: 2.5.3 + type-is: 1.6.18 + unpipe: 1.0.0 + transitivePeerDependencies: + - supports-color + body-parser@2.2.2: dependencies: bytes: 3.1.2 @@ -6796,6 +6990,10 @@ snapshots: consola@3.4.2: {} + content-disposition@0.5.4: + dependencies: + safe-buffer: 5.2.1 + content-disposition@1.0.1: {} content-type@1.0.5: {} @@ -6806,6 +7004,8 @@ snapshots: cookie-es@2.0.0: {} + cookie-signature@1.0.7: {} + cookie-signature@1.2.2: {} cookie@0.6.0: {} @@ -6921,6 +7121,10 @@ snapshots: db0@0.3.4: {} + debug@2.6.9: + dependencies: + ms: 2.0.0 + debug@4.4.3: dependencies: ms: 2.1.3 @@ -6954,6 +7158,8 @@ snapshots: destr@2.0.5: {} + destroy@1.2.0: {} + detect-libc@2.1.2: {} devalue@5.6.2: {} @@ -7148,6 +7354,42 @@ snapshots: expect-type@1.3.0: {} + express@4.22.1: + dependencies: + accepts: 1.3.8 + array-flatten: 1.1.1 + body-parser: 1.20.4 + content-disposition: 0.5.4 + content-type: 1.0.5 + cookie: 0.7.2 + cookie-signature: 1.0.7 + debug: 2.6.9 + depd: 2.0.0 + encodeurl: 2.0.0 + escape-html: 1.0.3 + etag: 1.8.1 + finalhandler: 1.3.2 + fresh: 0.5.2 + http-errors: 2.0.1 + merge-descriptors: 1.0.3 + methods: 1.1.2 + on-finished: 2.4.1 + parseurl: 1.3.3 + path-to-regexp: 0.1.12 + proxy-addr: 2.0.7 + qs: 6.14.1 + range-parser: 1.2.1 + safe-buffer: 5.2.1 + send: 0.19.2 + serve-static: 1.16.3 + setprototypeof: 1.2.0 + statuses: 2.0.2 + type-is: 1.6.18 + utils-merge: 1.0.1 + vary: 1.1.2 + transitivePeerDependencies: + - supports-color + express@5.2.1: dependencies: accepts: 2.0.0 @@ -7223,6 +7465,8 @@ snapshots: fastify-plugin@4.5.1: {} + fastify-plugin@5.1.0: {} + fastify@5.7.4: dependencies: '@fastify/ajv-compiler': 4.0.5 @@ -7264,6 +7508,18 @@ snapshots: dependencies: to-regex-range: 5.0.1 + finalhandler@1.3.2: + dependencies: + debug: 2.6.9 + encodeurl: 2.0.0 + escape-html: 1.0.3 + on-finished: 2.4.1 + parseurl: 1.3.3 + statuses: 2.0.2 + unpipe: 1.0.0 + transitivePeerDependencies: + - supports-color + finalhandler@2.1.1: dependencies: debug: 4.4.3 @@ -7296,6 +7552,8 @@ snapshots: fraction.js@5.3.4: {} + fresh@0.5.2: {} + fresh@2.0.0: {} fsevents@2.3.3: @@ -7700,27 +7958,41 @@ snapshots: mdn-data@2.12.2: {} + media-typer@0.3.0: {} + media-typer@1.1.0: {} memoirist@0.4.0: {} + merge-descriptors@1.0.3: {} + merge-descriptors@2.0.0: {} merge-stream@2.0.0: {} merge2@1.4.1: {} + methods@1.1.2: {} + micromatch@4.0.8: dependencies: braces: 3.0.3 picomatch: 2.3.1 + mime-db@1.52.0: {} + mime-db@1.54.0: {} + mime-types@2.1.35: + dependencies: + mime-db: 1.52.0 + mime-types@3.0.2: dependencies: mime-db: 1.54.0 + mime@1.6.0: {} + mime@4.1.0: {} mimic-fn@4.0.0: {} @@ -7758,6 +8030,8 @@ snapshots: mrmime@2.0.1: {} + ms@2.0.0: {} + ms@2.1.3: {} muggle-string@0.4.1: {} @@ -7774,6 +8048,8 @@ snapshots: nanotar@0.2.0: {} + negotiator@0.6.3: {} + negotiator@1.0.0: {} next@15.5.12(react-dom@19.2.4(react@18.3.1))(react@18.3.1): @@ -8223,6 +8499,8 @@ snapshots: lru-cache: 11.2.5 minipass: 7.1.2 + path-to-regexp@0.1.12: {} + path-to-regexp@8.3.0: {} pathe@1.1.2: {} @@ -8497,6 +8775,13 @@ snapshots: range-parser@1.2.1: {} + raw-body@2.5.3: + dependencies: + bytes: 3.1.2 + http-errors: 2.0.1 + iconv-lite: 0.4.24 + unpipe: 1.0.0 + raw-body@3.0.2: dependencies: bytes: 3.1.2 @@ -8664,6 +8949,24 @@ snapshots: semver@7.7.4: {} + send@0.19.2: + dependencies: + debug: 2.6.9 + depd: 2.0.0 + destroy: 1.2.0 + encodeurl: 2.0.0 + escape-html: 1.0.3 + etag: 1.8.1 + fresh: 0.5.2 + http-errors: 2.0.1 + mime: 1.6.0 + ms: 2.1.3 + on-finished: 2.4.1 + range-parser: 1.2.1 + statuses: 2.0.2 + transitivePeerDependencies: + - supports-color + send@1.2.1: dependencies: debug: 4.4.3 @@ -8690,6 +8993,15 @@ snapshots: dependencies: defu: 6.1.4 + serve-static@1.16.3: + dependencies: + encodeurl: 2.0.0 + escape-html: 1.0.3 + parseurl: 1.3.3 + send: 0.19.2 + transitivePeerDependencies: + - supports-color + serve-static@2.2.1: dependencies: encodeurl: 2.0.0 @@ -9065,6 +9377,11 @@ snapshots: dependencies: tagged-tag: 1.0.0 + type-is@1.6.18: + dependencies: + media-typer: 0.3.0 + mime-types: 2.1.35 + type-is@2.0.1: dependencies: content-type: 1.0.5 @@ -9212,6 +9529,8 @@ snapshots: util-deprecate@1.0.2: {} + utils-merge@1.0.1: {} + vary@1.1.2: {} vite-dev-rpc@1.1.0(vite@7.3.1(@types/node@20.19.32)(jiti@2.6.1)(terser@5.46.0)(yaml@2.8.2)): From 4df3a0103a0aa47354d0de8cc2172c418acbea08 Mon Sep 17 00:00:00 2001 From: Polliog Date: Sun, 8 Feb 2026 01:01:18 +0100 Subject: [PATCH 2/5] ci: add continue-on-error to publish steps Skip already-published versions (E403) without failing the workflow. --- .github/workflows/publish.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 467fc45..3f77fa6 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -157,66 +157,77 @@ jobs: # Publish in dependency order: types -> core -> all others - name: Publish @logtide/types + continue-on-error: true working-directory: packages/types run: pnpm publish --no-git-checks --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_SECRET }} - name: Publish @logtide/core + continue-on-error: true working-directory: packages/core run: pnpm publish --no-git-checks --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_SECRET }} - name: Publish @logtide/sdk-node + continue-on-error: true working-directory: packages/node run: pnpm publish --no-git-checks --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_SECRET }} - name: Publish @logtide/express + continue-on-error: true working-directory: packages/express run: pnpm publish --no-git-checks --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_SECRET }} - name: Publish @logtide/fastify + continue-on-error: true working-directory: packages/fastify run: pnpm publish --no-git-checks --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_SECRET }} - name: Publish @logtide/nextjs + continue-on-error: true working-directory: packages/nextjs run: pnpm publish --no-git-checks --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_SECRET }} - name: Publish @logtide/nuxt + continue-on-error: true working-directory: packages/nuxt run: pnpm publish --no-git-checks --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_SECRET }} - name: Publish @logtide/sveltekit + continue-on-error: true working-directory: packages/sveltekit run: pnpm publish --no-git-checks --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_SECRET }} - name: Publish @logtide/hono + continue-on-error: true working-directory: packages/hono run: pnpm publish --no-git-checks --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_SECRET }} - name: Publish @logtide/angular + continue-on-error: true working-directory: packages/angular run: pnpm publish --no-git-checks --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_SECRET }} - name: Publish @logtide/elysia + continue-on-error: true working-directory: packages/elysia run: pnpm publish --no-git-checks --access public env: From 09cf16fb64b42dc2c7d5d09718832cbc1408850b Mon Sep 17 00:00:00 2001 From: Polliog Date: Sun, 8 Feb 2026 12:54:18 +0100 Subject: [PATCH 3/5] feat: simplify DSN format and make service name optional in ClientOptions --- CHANGELOG.md | 22 ++++++++++++++++ README.md | 2 +- packages/angular/README.md | 4 +-- packages/angular/src/provide.ts | 2 ++ packages/core/README.md | 4 +-- packages/core/src/client.ts | 10 ++++--- packages/core/src/dsn.ts | 9 +++---- packages/core/src/scope.ts | 7 +++++ packages/core/src/transport/logtide-http.ts | 1 - packages/core/src/transport/otlp-http.ts | 1 - packages/core/tests/dsn.test.ts | 29 ++++++++++++++------- packages/elysia/README.md | 2 +- packages/elysia/src/plugin.ts | 1 + packages/express/README.md | 2 +- packages/express/src/middleware.ts | 1 + packages/fastify/README.md | 2 +- packages/fastify/src/middleware.ts | 1 + packages/hono/README.md | 2 +- packages/hono/src/middleware.ts | 1 + packages/nextjs/README.md | 4 +-- packages/nextjs/src/client/index.ts | 1 + packages/nextjs/src/server/index.ts | 1 + packages/nuxt/README.md | 2 +- packages/nuxt/src/module.ts | 2 +- packages/nuxt/src/runtime/client-plugin.ts | 4 +-- packages/nuxt/src/runtime/server-plugin.ts | 4 +-- packages/sveltekit/README.md | 4 +-- packages/sveltekit/src/server/index.ts | 1 + packages/types/README.md | 2 +- packages/types/src/client-options.ts | 7 +++-- test-apps/mock-server/src/server.ts | 6 +---- 31 files changed, 91 insertions(+), 50 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c695236..7de2b1c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,27 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.5.6] - 2026-02-08 + +### Changed + +#### DSN Simplified +- Removed redundant `projectId` from DSN format — the API key already embeds the project ID +- New DSN format: `https://lp_APIKEY@host` (legacy format with path still accepted for backward compatibility) +- Removed `projectId` field from `DSN` interface (`@logtide/types`) +- Removed `X-Project-Id` header from `LogtideHttpTransport` and `OtlpHttpTransport` (`@logtide/core`) + +#### Dynamic Service Name +- `service` in `ClientOptions` is now **optional** — each framework package defaults to its own name (`'express'`, `'fastify'`, `'hono'`, `'elysia'`, `'nextjs'`, `'sveltekit'`, `'nuxt'`, `'angular'`) +- Added `service?: string` field and `setService()` method to `Scope` — allows overriding service name per-request or per-module +- Service resolution chain: `scope.service` → `options.service` → framework default → `'unknown'` + +#### Mock Server +- Removed `X-Project-Id` from CORS headers and request tracking + +#### Documentation +- Updated DSN format examples across all package READMEs + ## [0.5.5] - 2026-02-07 ### Added @@ -77,4 +98,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Root README with package table, architecture diagram, development guide - Branch protection documentation (`.github/BRANCH_PROTECTION.md`) +[0.5.6]: https://github.com/logtide-dev/logtide-javascript/releases/tag/v0.5.6 [0.5.5]: https://github.com/logtide-dev/logtide-javascript/releases/tag/v0.5.5 diff --git a/README.md b/README.md index 1349a04..31365bc 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ npm install @logtide/elysia # Elysia ```typescript // Every integration follows the same pattern: { - dsn: 'https://lp_your_key@your-logtide-instance.com/project-id', + dsn: 'https://lp_your_key@your-logtide-instance.com', service: 'my-app', } ``` diff --git a/packages/angular/README.md b/packages/angular/README.md index 1327aae..c7777e9 100644 --- a/packages/angular/README.md +++ b/packages/angular/README.md @@ -52,7 +52,7 @@ export const appConfig: ApplicationConfig = { providers: [ provideHttpClient(withInterceptorsFromDi()), provideLogtide({ - dsn: 'https://lp_your_key@your-instance.com/project-id', + dsn: 'https://lp_your_key@your-instance.com', service: 'my-angular-app', environment: 'production', }), @@ -72,7 +72,7 @@ import { getLogtideProviders } from '@logtide/angular'; imports: [HttpClientModule], providers: [ ...getLogtideProviders({ - dsn: 'https://lp_your_key@your-instance.com/project-id', + dsn: 'https://lp_your_key@your-instance.com', service: 'my-angular-app', }), ], diff --git a/packages/angular/src/provide.ts b/packages/angular/src/provide.ts index 01cd2e1..78b4f4f 100644 --- a/packages/angular/src/provide.ts +++ b/packages/angular/src/provide.ts @@ -33,6 +33,7 @@ export function provideLogtide(options: ClientOptions): EnvironmentProviders { useFactory: () => { return () => { hub.init({ + service: 'angular', ...options, integrations: [ new GlobalErrorIntegration(), @@ -72,6 +73,7 @@ export function getLogtideProviders(options: ClientOptions): Provider[] { useFactory: () => { return () => { hub.init({ + service: 'angular', ...options, integrations: [ new GlobalErrorIntegration(), diff --git a/packages/core/README.md b/packages/core/README.md index dd42b75..a54d889 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -49,7 +49,7 @@ import { hub } from '@logtide/core'; // Initialize once hub.init({ - dsn: 'https://lp_your_key@your-instance.com/project-id', + dsn: 'https://lp_your_key@your-instance.com', service: 'my-app', }); @@ -81,7 +81,7 @@ process.on('SIGTERM', () => hub.close()); import { LogtideClient } from '@logtide/core'; const client = new LogtideClient({ - dsn: 'https://lp_your_key@your-instance.com/project-id', + dsn: 'https://lp_your_key@your-instance.com', service: 'my-app', }); diff --git a/packages/core/src/client.ts b/packages/core/src/client.ts index 3d44ebd..f5267ad 100644 --- a/packages/core/src/client.ts +++ b/packages/core/src/client.ts @@ -41,7 +41,7 @@ class DefaultTransport implements Transport { }); this.spanTransport = new BatchTransport({ - inner: new OtlpHttpTransport(dsn, options.service), + inner: new OtlpHttpTransport(dsn, options.service || 'unknown'), batchSize: options.batchSize, flushInterval: options.flushInterval, maxBufferSize: options.maxBufferSize, @@ -103,7 +103,7 @@ export class LogtideClient implements IClient { return this._isInitialized; } - get service(): string { + get service(): string | undefined { return this.options.service; } @@ -115,6 +115,10 @@ export class LogtideClient implements IClient { return this.options.release; } + private resolveService(scope?: Scope): string { + return scope?.service || this.options.service || 'unknown'; + } + // ─── Logging ─────────────────────────────────────────── captureLog( @@ -124,7 +128,7 @@ export class LogtideClient implements IClient { scope?: Scope, ): void { const entry: InternalLogEntry = { - service: this.options.service, + service: this.resolveService(scope), level: level as LogLevel, message, time: new Date().toISOString(), diff --git a/packages/core/src/dsn.ts b/packages/core/src/dsn.ts index fec484a..d236284 100644 --- a/packages/core/src/dsn.ts +++ b/packages/core/src/dsn.ts @@ -2,23 +2,20 @@ import type { DSN } from '@logtide/types'; /** * Parse a LogTide DSN string into its components. - * Format: https://lp_APIKEY@host/PROJECT_ID + * Format: https://lp_APIKEY@host + * Legacy format with path (https://lp_APIKEY@host/PROJECT_ID) is also accepted; the path is ignored. */ export function parseDSN(dsn: string): DSN { try { const url = new URL(dsn); const apiKey = url.username; - const projectId = url.pathname.replace(/^\//, ''); const apiUrl = `${url.protocol}//${url.host}`; if (!apiKey) { throw new Error('Missing API key in DSN'); } - if (!projectId) { - throw new Error('Missing project ID in DSN'); - } - return { apiUrl, apiKey, projectId }; + return { apiUrl, apiKey }; } catch (err) { if (err instanceof Error && err.message.startsWith('Missing')) { throw err; diff --git a/packages/core/src/scope.ts b/packages/core/src/scope.ts index 8fcea94..2ff5e65 100644 --- a/packages/core/src/scope.ts +++ b/packages/core/src/scope.ts @@ -5,6 +5,7 @@ import { BreadcrumbBuffer } from './breadcrumb-buffer'; export class Scope { traceId: string; spanId?: string; + service?: string; tags: Record = {}; extras: Record = {}; private breadcrumbs: BreadcrumbBuffer; @@ -15,6 +16,11 @@ export class Scope { this.breadcrumbs = new BreadcrumbBuffer(maxBreadcrumbs); } + setService(service: string): this { + this.service = service; + return this; + } + setTag(key: string, value: string): this { this.tags[key] = value; return this; @@ -51,6 +57,7 @@ export class Scope { clone(): Scope { const scope = new Scope(this.traceId); scope.spanId = this.spanId; + scope.service = this.service; scope.tags = { ...this.tags }; scope.extras = { ...this.extras }; for (const bc of this.breadcrumbs.getAll()) { diff --git a/packages/core/src/transport/logtide-http.ts b/packages/core/src/transport/logtide-http.ts index e73f435..3dcac2a 100644 --- a/packages/core/src/transport/logtide-http.ts +++ b/packages/core/src/transport/logtide-http.ts @@ -15,7 +15,6 @@ export class LogtideHttpTransport implements Transport { headers: { 'Content-Type': 'application/json', 'X-API-Key': this.dsn.apiKey, - 'X-Project-Id': this.dsn.projectId, }, body: JSON.stringify({ logs }), }); diff --git a/packages/core/src/transport/otlp-http.ts b/packages/core/src/transport/otlp-http.ts index 57e1cfa..973ee70 100644 --- a/packages/core/src/transport/otlp-http.ts +++ b/packages/core/src/transport/otlp-http.ts @@ -69,7 +69,6 @@ export class OtlpHttpTransport implements Transport { headers: { 'Content-Type': 'application/json', 'X-API-Key': this.dsn.apiKey, - 'X-Project-Id': this.dsn.projectId, }, body: JSON.stringify(payload), }); diff --git a/packages/core/tests/dsn.test.ts b/packages/core/tests/dsn.test.ts index 3b72b6a..9b52267 100644 --- a/packages/core/tests/dsn.test.ts +++ b/packages/core/tests/dsn.test.ts @@ -2,39 +2,48 @@ import { describe, it, expect } from 'vitest'; import { parseDSN } from '../src/dsn'; describe('parseDSN', () => { - it('should parse a valid DSN', () => { + it('should parse a DSN without path (new format)', () => { + const result = parseDSN('https://lp_abc123@api.logtide.dev'); + expect(result).toEqual({ + apiUrl: 'https://api.logtide.dev', + apiKey: 'lp_abc123', + }); + }); + + it('should accept legacy DSN with project ID path and ignore it', () => { const result = parseDSN('https://lp_abc123@api.logtide.dev/my-project'); expect(result).toEqual({ apiUrl: 'https://api.logtide.dev', apiKey: 'lp_abc123', - projectId: 'my-project', }); }); it('should handle DSN with port', () => { - const result = parseDSN('https://lp_key@localhost:3000/proj1'); + const result = parseDSN('https://lp_key@localhost:3000'); expect(result).toEqual({ apiUrl: 'https://localhost:3000', apiKey: 'lp_key', - projectId: 'proj1', }); }); it('should handle http scheme', () => { - const result = parseDSN('http://lp_key@localhost/project'); + const result = parseDSN('http://lp_key@localhost'); expect(result).toEqual({ apiUrl: 'http://localhost', apiKey: 'lp_key', - projectId: 'project', }); }); - it('should throw on missing API key', () => { - expect(() => parseDSN('https://api.logtide.dev/project')).toThrow('Missing API key'); + it('should handle DSN with trailing slash', () => { + const result = parseDSN('https://lp_key@api.logtide.dev/'); + expect(result).toEqual({ + apiUrl: 'https://api.logtide.dev', + apiKey: 'lp_key', + }); }); - it('should throw on missing project ID', () => { - expect(() => parseDSN('https://lp_key@api.logtide.dev/')).toThrow('Missing project ID'); + it('should throw on missing API key', () => { + expect(() => parseDSN('https://api.logtide.dev/project')).toThrow('Missing API key'); }); it('should throw on invalid DSN string', () => { diff --git a/packages/elysia/README.md b/packages/elysia/README.md index e7354cd..ad092ca 100644 --- a/packages/elysia/README.md +++ b/packages/elysia/README.md @@ -47,7 +47,7 @@ import { logtide } from '@logtide/elysia'; const app = new Elysia() .use(logtide({ - dsn: 'https://lp_your_key@your-instance.com/project-id', + dsn: 'https://lp_your_key@your-instance.com', service: 'my-elysia-api', environment: 'production', })) diff --git a/packages/elysia/src/plugin.ts b/packages/elysia/src/plugin.ts index ae70dcb..42f6cd7 100644 --- a/packages/elysia/src/plugin.ts +++ b/packages/elysia/src/plugin.ts @@ -27,6 +27,7 @@ export interface LogtideElysiaOptions extends ClientOptions {} */ export function logtide(options: LogtideElysiaOptions) { hub.init({ + service: 'elysia', ...options, integrations: [ new ConsoleIntegration(), diff --git a/packages/express/README.md b/packages/express/README.md index 4e94457..d0d769a 100644 --- a/packages/express/README.md +++ b/packages/express/README.md @@ -48,7 +48,7 @@ import { logtide } from '@logtide/express'; const app = express(); app.use(logtide({ - dsn: 'https://lp_your_key@your-instance.com/project-id', + dsn: 'https://lp_your_key@your-instance.com', service: 'my-express-api', environment: 'production', })); diff --git a/packages/express/src/middleware.ts b/packages/express/src/middleware.ts index e26a108..f32bfc0 100644 --- a/packages/express/src/middleware.ts +++ b/packages/express/src/middleware.ts @@ -35,6 +35,7 @@ declare global { */ export function logtide(options: LogtideExpressOptions) { hub.init({ + service: 'express', ...options, integrations: [ new ConsoleIntegration(), diff --git a/packages/fastify/README.md b/packages/fastify/README.md index 1f3a509..b82f695 100644 --- a/packages/fastify/README.md +++ b/packages/fastify/README.md @@ -48,7 +48,7 @@ import { logtide } from '@logtide/fastify'; const app = Fastify(); await app.register(logtide, { - dsn: 'https://lp_your_key@your-instance.com/project-id', + dsn: 'https://lp_your_key@your-instance.com', service: 'my-fastify-api', environment: 'production', }); diff --git a/packages/fastify/src/middleware.ts b/packages/fastify/src/middleware.ts index 7f97936..97147f8 100644 --- a/packages/fastify/src/middleware.ts +++ b/packages/fastify/src/middleware.ts @@ -35,6 +35,7 @@ declare module 'fastify' { export const logtide = fp( (fastify: FastifyInstance, options: LogtideFastifyOptions, done: (err?: Error) => void) => { hub.init({ + service: 'fastify', ...options, integrations: [ new ConsoleIntegration(), diff --git a/packages/hono/README.md b/packages/hono/README.md index 52e02a8..93e2c71 100644 --- a/packages/hono/README.md +++ b/packages/hono/README.md @@ -48,7 +48,7 @@ import { logtide } from '@logtide/hono'; const app = new Hono(); app.use('*', logtide({ - dsn: 'https://lp_your_key@your-instance.com/project-id', + dsn: 'https://lp_your_key@your-instance.com', service: 'my-hono-api', environment: 'production', })); diff --git a/packages/hono/src/middleware.ts b/packages/hono/src/middleware.ts index 6f80cae..99f88a8 100644 --- a/packages/hono/src/middleware.ts +++ b/packages/hono/src/middleware.ts @@ -26,6 +26,7 @@ export interface LogtideHonoOptions extends ClientOptions {} */ export function logtide(options: LogtideHonoOptions) { hub.init({ + service: 'hono', ...options, integrations: [ new ConsoleIntegration(), diff --git a/packages/nextjs/README.md b/packages/nextjs/README.md index 646a048..3c4131b 100644 --- a/packages/nextjs/README.md +++ b/packages/nextjs/README.md @@ -51,7 +51,7 @@ import { registerLogtide, captureRequestError } from '@logtide/nextjs/server'; export async function register() { await registerLogtide({ - dsn: 'https://lp_your_key@your-instance.com/project-id', + dsn: 'https://lp_your_key@your-instance.com', service: 'my-nextjs-app', environment: process.env.NODE_ENV, }); @@ -72,7 +72,7 @@ import { useEffect } from 'react'; import { initLogtide, trackNavigation } from '@logtide/nextjs/client'; initLogtide({ - dsn: 'https://lp_your_key@your-instance.com/project-id', + dsn: 'https://lp_your_key@your-instance.com', service: 'my-nextjs-app', }); diff --git a/packages/nextjs/src/client/index.ts b/packages/nextjs/src/client/index.ts index 491f9bd..0f7eaea 100644 --- a/packages/nextjs/src/client/index.ts +++ b/packages/nextjs/src/client/index.ts @@ -17,6 +17,7 @@ export { trackNavigation } from './navigation'; */ export function initLogtide(options: ClientOptions): void { hub.init({ + service: 'nextjs', ...options, integrations: [ new GlobalErrorIntegration(), diff --git a/packages/nextjs/src/server/index.ts b/packages/nextjs/src/server/index.ts index 5e0e7ff..1ff8179 100644 --- a/packages/nextjs/src/server/index.ts +++ b/packages/nextjs/src/server/index.ts @@ -21,6 +21,7 @@ export { instrumentRequest, finishRequest } from './request-handler'; */ export async function registerLogtide(options: ClientOptions): Promise { hub.init({ + service: 'nextjs', ...options, integrations: [ new ConsoleIntegration(), diff --git a/packages/nuxt/README.md b/packages/nuxt/README.md index cc69e9b..0e07148 100644 --- a/packages/nuxt/README.md +++ b/packages/nuxt/README.md @@ -49,7 +49,7 @@ export default defineNuxtConfig({ modules: ['@logtide/nuxt'], logtide: { - dsn: 'https://lp_your_key@your-instance.com/project-id', + dsn: 'https://lp_your_key@your-instance.com', service: 'my-nuxt-app', environment: 'production', release: '1.0.0', diff --git a/packages/nuxt/src/module.ts b/packages/nuxt/src/module.ts index 03268bf..b54d476 100644 --- a/packages/nuxt/src/module.ts +++ b/packages/nuxt/src/module.ts @@ -11,7 +11,7 @@ export default defineNuxtModule({ }, defaults: { dsn: '', - service: 'nuxt-app', + service: 'nuxt', }, setup(options, nuxt) { if (!options.dsn) { diff --git a/packages/nuxt/src/runtime/client-plugin.ts b/packages/nuxt/src/runtime/client-plugin.ts index 102db37..7a0fce2 100644 --- a/packages/nuxt/src/runtime/client-plugin.ts +++ b/packages/nuxt/src/runtime/client-plugin.ts @@ -7,7 +7,7 @@ import { defineNuxtPlugin, useRuntimeConfig } from '#app'; export default defineNuxtPlugin((nuxtApp) => { const config = useRuntimeConfig().public.logtide as { dsn: string; - service: string; + service?: string; environment?: string; release?: string; debug?: boolean; @@ -17,7 +17,7 @@ export default defineNuxtPlugin((nuxtApp) => { hub.init({ dsn: config.dsn, - service: config.service, + service: config.service ?? 'nuxt', environment: config.environment, release: config.release, debug: config.debug, diff --git a/packages/nuxt/src/runtime/server-plugin.ts b/packages/nuxt/src/runtime/server-plugin.ts index da48d5a..5dd9e50 100644 --- a/packages/nuxt/src/runtime/server-plugin.ts +++ b/packages/nuxt/src/runtime/server-plugin.ts @@ -13,7 +13,7 @@ import { defineNitroPlugin, getRequestURL, getRequestHeaders } from 'h3'; export default defineNitroPlugin((nitroApp) => { const config = useRuntimeConfig().logtide as { dsn: string; - service: string; + service?: string; environment?: string; release?: string; debug?: boolean; @@ -23,7 +23,7 @@ export default defineNitroPlugin((nitroApp) => { hub.init({ dsn: config.dsn, - service: config.service, + service: config.service ?? 'nuxt', environment: config.environment, release: config.release, debug: config.debug, diff --git a/packages/sveltekit/README.md b/packages/sveltekit/README.md index 4640338..c60c53b 100644 --- a/packages/sveltekit/README.md +++ b/packages/sveltekit/README.md @@ -48,7 +48,7 @@ yarn add @logtide/sveltekit import { logtideHandle, logtideHandleError, logtideHandleFetch } from '@logtide/sveltekit/server'; export const handle = logtideHandle({ - dsn: 'https://lp_your_key@your-instance.com/project-id', + dsn: 'https://lp_your_key@your-instance.com', service: 'my-sveltekit-app', environment: 'production', }); @@ -65,7 +65,7 @@ export const handleFetch = logtideHandleFetch(); import { initLogtide } from '@logtide/sveltekit/client'; initLogtide({ - dsn: 'https://lp_your_key@your-instance.com/project-id', + dsn: 'https://lp_your_key@your-instance.com', service: 'my-sveltekit-app', }); ``` diff --git a/packages/sveltekit/src/server/index.ts b/packages/sveltekit/src/server/index.ts index 1c8c79b..f8e0a08 100644 --- a/packages/sveltekit/src/server/index.ts +++ b/packages/sveltekit/src/server/index.ts @@ -48,6 +48,7 @@ interface HandleFetchInput { */ export function logtideHandle(options: ClientOptions) { hub.init({ + service: 'sveltekit', ...options, integrations: [ new ConsoleIntegration(), diff --git a/packages/types/README.md b/packages/types/README.md index edee688..92edb25 100644 --- a/packages/types/README.md +++ b/packages/types/README.md @@ -88,7 +88,7 @@ import type { ClientOptions, DSN } from '@logtide/types'; | Type | Description | |------|-------------| | `ClientOptions` | Full configuration: DSN, service, batching, retry, circuit breaker, etc. | -| `DSN` | Parsed DSN with `apiUrl`, `apiKey`, `projectId` | +| `DSN` | Parsed DSN with `apiUrl`, `apiKey` | --- diff --git a/packages/types/src/client-options.ts b/packages/types/src/client-options.ts index 6276c2e..05c028b 100644 --- a/packages/types/src/client-options.ts +++ b/packages/types/src/client-options.ts @@ -4,14 +4,13 @@ import type { Transport } from './transport'; export interface DSN { apiUrl: string; apiKey: string; - projectId: string; } export interface ClientOptions { - /** DSN string: https://lp_APIKEY@api.logtide.dev/PROJECT_ID */ + /** DSN string: https://lp_APIKEY@api.logtide.dev */ dsn: string; - /** Service name for log attribution */ - service: string; + /** Service name for log attribution (optional, defaults to framework name) */ + service?: string; /** Environment (e.g. production, staging) */ environment?: string; /** Release / version identifier */ diff --git a/test-apps/mock-server/src/server.ts b/test-apps/mock-server/src/server.ts index 969676e..aecad90 100644 --- a/test-apps/mock-server/src/server.ts +++ b/test-apps/mock-server/src/server.ts @@ -30,7 +30,6 @@ export interface MockServerState { requests: Array<{ timestamp: number; apiKey: string | null; - projectId: string | null; endpoint: string; count: number; }>; @@ -59,7 +58,7 @@ export function createMockServer() { // CORS res.setHeader('Access-Control-Allow-Origin', '*'); res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS'); - res.setHeader('Access-Control-Allow-Headers', 'Content-Type, X-API-Key, X-Project-Id'); + res.setHeader('Access-Control-Allow-Headers', 'Content-Type, X-API-Key'); if (method === 'OPTIONS') { res.writeHead(204); @@ -69,7 +68,6 @@ export function createMockServer() { try { const apiKey = req.headers['x-api-key'] as string | undefined; - const projectId = req.headers['x-project-id'] as string | undefined; // Ingest endpoint - receives logs from SDK if (url.pathname === '/api/v1/ingest' && method === 'POST') { @@ -81,7 +79,6 @@ export function createMockServer() { state.requests.push({ timestamp: Date.now(), apiKey: apiKey ?? null, - projectId: projectId ?? null, endpoint: '/api/v1/ingest', count: logs.length, }); @@ -118,7 +115,6 @@ export function createMockServer() { state.requests.push({ timestamp: Date.now(), apiKey: apiKey ?? null, - projectId: projectId ?? null, endpoint: '/v1/otlp/traces', count: spans.length, }); From 516a48dc446720770e11fc1ccc6ce80809ef075e Mon Sep 17 00:00:00 2001 From: Polliog Date: Sun, 8 Feb 2026 13:03:10 +0100 Subject: [PATCH 4/5] feat: simplify DSN format and make service name optional in ClientOptions --- CHANGELOG.md | 2 + README.md | 7 ++++ packages/angular/README.md | 4 ++ packages/core/README.md | 6 +++ packages/core/src/client.ts | 4 +- packages/core/src/dsn.ts | 19 +++++++++- packages/core/src/index.ts | 2 +- packages/core/tests/dsn.test.ts | 56 +++++++++++++++++++++++++++- packages/elysia/README.md | 3 ++ packages/express/README.md | 3 ++ packages/fastify/README.md | 3 ++ packages/hono/README.md | 3 ++ packages/nextjs/README.md | 10 ++++- packages/nuxt/README.md | 3 ++ packages/sveltekit/README.md | 4 ++ packages/types/README.md | 2 +- packages/types/src/client-options.ts | 6 ++- 17 files changed, 128 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7de2b1c..43fb355 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### DSN Simplified - Removed redundant `projectId` from DSN format — the API key already embeds the project ID - New DSN format: `https://lp_APIKEY@host` (legacy format with path still accepted for backward compatibility) +- Added `apiUrl` + `apiKey` as alternative to DSN string (backward compatible with `@logtide/sdk-node` config format) +- Added `resolveDSN()` helper that accepts either `dsn` or `apiUrl` + `apiKey` - Removed `projectId` field from `DSN` interface (`@logtide/types`) - Removed `X-Project-Id` header from `LogtideHttpTransport` and `OtlpHttpTransport` (`@logtide/core`) diff --git a/README.md b/README.md index 31365bc..1a7e992 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,13 @@ npm install @logtide/elysia # Elysia dsn: 'https://lp_your_key@your-logtide-instance.com', service: 'my-app', } + +// Or use apiUrl + apiKey separately: +{ + apiUrl: 'https://your-logtide-instance.com', + apiKey: 'lp_your_key', + service: 'my-app', +} ``` See each package's README for framework-specific setup instructions. diff --git a/packages/angular/README.md b/packages/angular/README.md index c7777e9..bad6cfe 100644 --- a/packages/angular/README.md +++ b/packages/angular/README.md @@ -53,6 +53,9 @@ export const appConfig: ApplicationConfig = { provideHttpClient(withInterceptorsFromDi()), provideLogtide({ dsn: 'https://lp_your_key@your-instance.com', + // Or use apiUrl + apiKey instead of dsn: + // apiUrl: 'https://your-instance.com', + // apiKey: 'lp_your_key', service: 'my-angular-app', environment: 'production', }), @@ -73,6 +76,7 @@ import { getLogtideProviders } from '@logtide/angular'; providers: [ ...getLogtideProviders({ dsn: 'https://lp_your_key@your-instance.com', + // Or: apiUrl + apiKey instead of dsn service: 'my-angular-app', }), ], diff --git a/packages/core/README.md b/packages/core/README.md index a54d889..bad173d 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -50,6 +50,9 @@ import { hub } from '@logtide/core'; // Initialize once hub.init({ dsn: 'https://lp_your_key@your-instance.com', + // Or use apiUrl + apiKey instead of dsn: + // apiUrl: 'https://your-instance.com', + // apiKey: 'lp_your_key', service: 'my-app', }); @@ -82,6 +85,9 @@ import { LogtideClient } from '@logtide/core'; const client = new LogtideClient({ dsn: 'https://lp_your_key@your-instance.com', + // Or use apiUrl + apiKey instead of dsn: + // apiUrl: 'https://your-instance.com', + // apiKey: 'lp_your_key', service: 'my-app', }); diff --git a/packages/core/src/client.ts b/packages/core/src/client.ts index f5267ad..efe6f26 100644 --- a/packages/core/src/client.ts +++ b/packages/core/src/client.ts @@ -8,7 +8,7 @@ import type { Span, Transport, } from '@logtide/types'; -import { parseDSN } from './dsn'; +import { resolveDSN } from './dsn'; import { Scope } from './scope'; import { SpanManager, type StartSpanOptions } from './span-manager'; import { BreadcrumbBuffer } from './breadcrumb-buffer'; @@ -26,7 +26,7 @@ class DefaultTransport implements Transport { private spanTransport: BatchTransport; constructor(options: ClientOptions) { - const dsn = parseDSN(options.dsn); + const dsn = resolveDSN(options); this.logTransport = new BatchTransport({ inner: new LogtideHttpTransport(dsn), diff --git a/packages/core/src/dsn.ts b/packages/core/src/dsn.ts index d236284..430e996 100644 --- a/packages/core/src/dsn.ts +++ b/packages/core/src/dsn.ts @@ -1,4 +1,4 @@ -import type { DSN } from '@logtide/types'; +import type { ClientOptions, DSN } from '@logtide/types'; /** * Parse a LogTide DSN string into its components. @@ -23,3 +23,20 @@ export function parseDSN(dsn: string): DSN { throw new Error(`Invalid DSN: ${dsn}`); } } + +/** + * Resolve a DSN from ClientOptions. + * Accepts either a `dsn` string or separate `apiUrl` + `apiKey` fields. + */ +export function resolveDSN(options: ClientOptions): DSN { + if (options.dsn) { + return parseDSN(options.dsn); + } + if (options.apiUrl && options.apiKey) { + return { + apiUrl: options.apiUrl.replace(/\/$/, ''), + apiKey: options.apiKey, + }; + } + throw new Error('Either "dsn" or both "apiUrl" and "apiKey" must be provided'); +} diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 3232db6..ed1ce83 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -23,7 +23,7 @@ export { SpanManager, type StartSpanOptions } from './span-manager'; export { BreadcrumbBuffer } from './breadcrumb-buffer'; // DSN -export { parseDSN } from './dsn'; +export { parseDSN, resolveDSN } from './dsn'; // Transports export { LogtideHttpTransport } from './transport/logtide-http'; diff --git a/packages/core/tests/dsn.test.ts b/packages/core/tests/dsn.test.ts index 9b52267..b96c202 100644 --- a/packages/core/tests/dsn.test.ts +++ b/packages/core/tests/dsn.test.ts @@ -1,5 +1,5 @@ import { describe, it, expect } from 'vitest'; -import { parseDSN } from '../src/dsn'; +import { parseDSN, resolveDSN } from '../src/dsn'; describe('parseDSN', () => { it('should parse a DSN without path (new format)', () => { @@ -54,3 +54,57 @@ describe('parseDSN', () => { expect(() => parseDSN('')).toThrow('Invalid DSN'); }); }); + +describe('resolveDSN', () => { + it('should resolve from dsn string', () => { + const result = resolveDSN({ dsn: 'https://lp_key@api.logtide.dev' }); + expect(result).toEqual({ + apiUrl: 'https://api.logtide.dev', + apiKey: 'lp_key', + }); + }); + + it('should resolve from apiUrl + apiKey', () => { + const result = resolveDSN({ apiUrl: 'http://localhost:8080', apiKey: 'lp_test_key' }); + expect(result).toEqual({ + apiUrl: 'http://localhost:8080', + apiKey: 'lp_test_key', + }); + }); + + it('should strip trailing slash from apiUrl', () => { + const result = resolveDSN({ apiUrl: 'http://localhost:8080/', apiKey: 'lp_key' }); + expect(result).toEqual({ + apiUrl: 'http://localhost:8080', + apiKey: 'lp_key', + }); + }); + + it('should prefer dsn over apiUrl + apiKey when both provided', () => { + const result = resolveDSN({ + dsn: 'https://lp_dsn_key@api.logtide.dev', + apiUrl: 'http://localhost:8080', + apiKey: 'lp_other_key', + }); + expect(result).toEqual({ + apiUrl: 'https://api.logtide.dev', + apiKey: 'lp_dsn_key', + }); + }); + + it('should throw when neither dsn nor apiUrl+apiKey provided', () => { + expect(() => resolveDSN({})).toThrow('Either "dsn" or both "apiUrl" and "apiKey" must be provided'); + }); + + it('should throw when only apiUrl provided without apiKey', () => { + expect(() => resolveDSN({ apiUrl: 'http://localhost:8080' })).toThrow( + 'Either "dsn" or both "apiUrl" and "apiKey" must be provided', + ); + }); + + it('should throw when only apiKey provided without apiUrl', () => { + expect(() => resolveDSN({ apiKey: 'lp_key' })).toThrow( + 'Either "dsn" or both "apiUrl" and "apiKey" must be provided', + ); + }); +}); diff --git a/packages/elysia/README.md b/packages/elysia/README.md index ad092ca..0e45fab 100644 --- a/packages/elysia/README.md +++ b/packages/elysia/README.md @@ -48,6 +48,9 @@ import { logtide } from '@logtide/elysia'; const app = new Elysia() .use(logtide({ dsn: 'https://lp_your_key@your-instance.com', + // Or use apiUrl + apiKey instead of dsn: + // apiUrl: 'https://your-instance.com', + // apiKey: 'lp_your_key', service: 'my-elysia-api', environment: 'production', })) diff --git a/packages/express/README.md b/packages/express/README.md index d0d769a..b0ee878 100644 --- a/packages/express/README.md +++ b/packages/express/README.md @@ -49,6 +49,9 @@ const app = express(); app.use(logtide({ dsn: 'https://lp_your_key@your-instance.com', + // Or use apiUrl + apiKey instead of dsn: + // apiUrl: 'https://your-instance.com', + // apiKey: 'lp_your_key', service: 'my-express-api', environment: 'production', })); diff --git a/packages/fastify/README.md b/packages/fastify/README.md index b82f695..4dd339c 100644 --- a/packages/fastify/README.md +++ b/packages/fastify/README.md @@ -49,6 +49,9 @@ const app = Fastify(); await app.register(logtide, { dsn: 'https://lp_your_key@your-instance.com', + // Or use apiUrl + apiKey instead of dsn: + // apiUrl: 'https://your-instance.com', + // apiKey: 'lp_your_key', service: 'my-fastify-api', environment: 'production', }); diff --git a/packages/hono/README.md b/packages/hono/README.md index 93e2c71..b9bfc31 100644 --- a/packages/hono/README.md +++ b/packages/hono/README.md @@ -49,6 +49,9 @@ const app = new Hono(); app.use('*', logtide({ dsn: 'https://lp_your_key@your-instance.com', + // Or use apiUrl + apiKey instead of dsn: + // apiUrl: 'https://your-instance.com', + // apiKey: 'lp_your_key', service: 'my-hono-api', environment: 'production', })); diff --git a/packages/nextjs/README.md b/packages/nextjs/README.md index 3c4131b..10e7329 100644 --- a/packages/nextjs/README.md +++ b/packages/nextjs/README.md @@ -52,6 +52,9 @@ import { registerLogtide, captureRequestError } from '@logtide/nextjs/server'; export async function register() { await registerLogtide({ dsn: 'https://lp_your_key@your-instance.com', + // Or use apiUrl + apiKey instead of dsn: + // apiUrl: 'https://your-instance.com', + // apiKey: 'lp_your_key', service: 'my-nextjs-app', environment: process.env.NODE_ENV, }); @@ -73,6 +76,9 @@ import { initLogtide, trackNavigation } from '@logtide/nextjs/client'; initLogtide({ dsn: 'https://lp_your_key@your-instance.com', + // Or use apiUrl + apiKey instead of dsn: + // apiUrl: 'https://your-instance.com', + // apiKey: 'lp_your_key', service: 'my-nextjs-app', }); @@ -99,7 +105,7 @@ Initialize LogTide in Next.js `instrumentation.ts`. Automatically installs `Cons import { registerLogtide } from '@logtide/nextjs/server'; await registerLogtide({ - dsn: 'https://lp_key@host/project', + dsn: 'https://lp_key@host', service: 'my-app', environment: 'production', release: '1.0.0', @@ -156,7 +162,7 @@ Initialize LogTide on the client side. Installs `GlobalErrorIntegration` for `un import { initLogtide } from '@logtide/nextjs/client'; initLogtide({ - dsn: 'https://lp_key@host/project', + dsn: 'https://lp_key@host', service: 'my-app', }); ``` diff --git a/packages/nuxt/README.md b/packages/nuxt/README.md index 0e07148..d32ab31 100644 --- a/packages/nuxt/README.md +++ b/packages/nuxt/README.md @@ -50,6 +50,9 @@ export default defineNuxtConfig({ logtide: { dsn: 'https://lp_your_key@your-instance.com', + // Or use apiUrl + apiKey instead of dsn: + // apiUrl: 'https://your-instance.com', + // apiKey: 'lp_your_key', service: 'my-nuxt-app', environment: 'production', release: '1.0.0', diff --git a/packages/sveltekit/README.md b/packages/sveltekit/README.md index c60c53b..655f1e9 100644 --- a/packages/sveltekit/README.md +++ b/packages/sveltekit/README.md @@ -49,6 +49,9 @@ import { logtideHandle, logtideHandleError, logtideHandleFetch } from '@logtide/ export const handle = logtideHandle({ dsn: 'https://lp_your_key@your-instance.com', + // Or use apiUrl + apiKey instead of dsn: + // apiUrl: 'https://your-instance.com', + // apiKey: 'lp_your_key', service: 'my-sveltekit-app', environment: 'production', }); @@ -66,6 +69,7 @@ import { initLogtide } from '@logtide/sveltekit/client'; initLogtide({ dsn: 'https://lp_your_key@your-instance.com', + // Or: apiUrl + apiKey instead of dsn service: 'my-sveltekit-app', }); ``` diff --git a/packages/types/README.md b/packages/types/README.md index 92edb25..3b2a5db 100644 --- a/packages/types/README.md +++ b/packages/types/README.md @@ -87,7 +87,7 @@ import type { ClientOptions, DSN } from '@logtide/types'; | Type | Description | |------|-------------| -| `ClientOptions` | Full configuration: DSN, service, batching, retry, circuit breaker, etc. | +| `ClientOptions` | Full configuration: DSN (or `apiUrl` + `apiKey`), service, batching, retry, circuit breaker, etc. | | `DSN` | Parsed DSN with `apiUrl`, `apiKey` | --- diff --git a/packages/types/src/client-options.ts b/packages/types/src/client-options.ts index 05c028b..c14c698 100644 --- a/packages/types/src/client-options.ts +++ b/packages/types/src/client-options.ts @@ -8,7 +8,11 @@ export interface DSN { export interface ClientOptions { /** DSN string: https://lp_APIKEY@api.logtide.dev */ - dsn: string; + dsn?: string; + /** API base URL (alternative to DSN, e.g. 'http://localhost:8080') */ + apiUrl?: string; + /** API key (alternative to DSN, e.g. 'lp_your_api_key_here') */ + apiKey?: string; /** Service name for log attribution (optional, defaults to framework name) */ service?: string; /** Environment (e.g. production, staging) */ From 84f39608c762c7b4593856aeabd9b9a2761dab95 Mon Sep 17 00:00:00 2001 From: Polliog Date: Sun, 8 Feb 2026 13:03:58 +0100 Subject: [PATCH 5/5] chore: bump version to 0.5.6 for all LogTide packages --- package.json | 2 +- packages/angular/package.json | 2 +- packages/core/package.json | 2 +- packages/elysia/package.json | 2 +- packages/express/package.json | 2 +- packages/fastify/package.json | 2 +- packages/hono/package.json | 2 +- packages/nextjs/package.json | 2 +- packages/nuxt/package.json | 2 +- packages/sveltekit/package.json | 2 +- packages/types/package.json | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 0d8aead..eb9c908 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "private": true, - "version": "0.5.5", + "version": "0.5.6", "scripts": { "build": "pnpm -r --filter @logtide/* build", "test": "pnpm -r --filter @logtide/* test", diff --git a/packages/angular/package.json b/packages/angular/package.json index b51e1a0..3820129 100644 --- a/packages/angular/package.json +++ b/packages/angular/package.json @@ -1,6 +1,6 @@ { "name": "@logtide/angular", - "version": "0.5.5", + "version": "0.5.6", "description": "LogTide SDK integration for Angular — ErrorHandler, HTTP Interceptor, trace propagation", "type": "module", "main": "./dist/index.cjs", diff --git a/packages/core/package.json b/packages/core/package.json index 1591560..06beb10 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@logtide/core", - "version": "0.5.5", + "version": "0.5.6", "description": "Core client, hub, scope, transports, and utilities for the LogTide SDK", "type": "module", "main": "./dist/index.cjs", diff --git a/packages/elysia/package.json b/packages/elysia/package.json index bb0b149..f0c61f4 100644 --- a/packages/elysia/package.json +++ b/packages/elysia/package.json @@ -1,6 +1,6 @@ { "name": "@logtide/elysia", - "version": "0.5.5", + "version": "0.5.6", "description": "LogTide SDK plugin for Elysia — request tracing and error capture via lifecycle hooks", "type": "module", "main": "./dist/index.cjs", diff --git a/packages/express/package.json b/packages/express/package.json index ec36df5..814895a 100644 --- a/packages/express/package.json +++ b/packages/express/package.json @@ -1,6 +1,6 @@ { "name": "@logtide/express", - "version": "0.5.5", + "version": "0.5.6", "description": "LogTide SDK middleware for Express — request tracing and error capture", "type": "module", "main": "./dist/index.cjs", diff --git a/packages/fastify/package.json b/packages/fastify/package.json index 39b9ed6..4729653 100644 --- a/packages/fastify/package.json +++ b/packages/fastify/package.json @@ -1,6 +1,6 @@ { "name": "@logtide/fastify", - "version": "0.5.5", + "version": "0.5.6", "description": "LogTide SDK plugin for Fastify — request tracing and error capture", "type": "module", "main": "./dist/index.cjs", diff --git a/packages/hono/package.json b/packages/hono/package.json index 80ba470..d8d9318 100644 --- a/packages/hono/package.json +++ b/packages/hono/package.json @@ -1,6 +1,6 @@ { "name": "@logtide/hono", - "version": "0.5.5", + "version": "0.5.6", "description": "LogTide SDK middleware for Hono — request tracing and error capture", "type": "module", "main": "./dist/index.cjs", diff --git a/packages/nextjs/package.json b/packages/nextjs/package.json index 989e60d..7e0017f 100644 --- a/packages/nextjs/package.json +++ b/packages/nextjs/package.json @@ -1,6 +1,6 @@ { "name": "@logtide/nextjs", - "version": "0.5.5", + "version": "0.5.6", "description": "LogTide SDK integration for Next.js — auto error capture, request tracing, and performance spans", "type": "module", "main": "./dist/index.cjs", diff --git a/packages/nuxt/package.json b/packages/nuxt/package.json index 018097c..1e1ef73 100644 --- a/packages/nuxt/package.json +++ b/packages/nuxt/package.json @@ -1,6 +1,6 @@ { "name": "@logtide/nuxt", - "version": "0.5.5", + "version": "0.5.6", "description": "LogTide SDK integration for Nuxt — auto error capture, request tracing via Nitro hooks", "type": "module", "main": "./dist/module.cjs", diff --git a/packages/sveltekit/package.json b/packages/sveltekit/package.json index 611eb3c..0b5dc4f 100644 --- a/packages/sveltekit/package.json +++ b/packages/sveltekit/package.json @@ -1,6 +1,6 @@ { "name": "@logtide/sveltekit", - "version": "0.5.5", + "version": "0.5.6", "description": "LogTide SDK integration for SvelteKit — handle, handleError, handleFetch hooks", "type": "module", "main": "./dist/index.cjs", diff --git a/packages/types/package.json b/packages/types/package.json index 9d4e6aa..64ea3da 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@logtide/types", - "version": "0.5.5", + "version": "0.5.6", "description": "Shared type definitions for the LogTide SDK ecosystem", "type": "module", "main": "./dist/index.cjs",