{"_id":"@aphexcms/auth","_rev":"4-00cacbddc69dd75470f569147696cadf","name":"@aphexcms/auth","dist-tags":{"latest":"0.2.2"},"versions":{"0.1.0":{"name":"@aphexcms/auth","version":"0.1.0","license":"MIT","_id":"@aphexcms/auth@0.1.0","maintainers":[{"name":"rainbowasian96","email":"benjaminsinidol@gmail.com"}],"homepage":"https://github.com/IcelandicIcecream/aphex#readme","bugs":{"url":"https://github.com/IcelandicIcecream/aphex/issues"},"dist":{"shasum":"672b0d0a4b227e8e3125c12ad4d8556352e127c3","tarball":"https://registry.npmjs.org/@aphexcms/auth/-/auth-0.1.0.tgz","fileCount":38,"integrity":"sha512-fqquwGaswYkdYOA2hdGEbNVOl/wKqkKjPOpAo2s6GCd8fJbrW0uCL7xztLwTDJkUyIFbeWeEy49oPRqTzLEt+g==","signatures":[{"sig":"MEYCIQDR8xHZLQ3BNMfhY6QFg9aG+VJvU/iIONF2LCht6rtihwIhAMTriWum101ta5L67Lu4SQlews1OQ9wWWyk9G6zkkL/p","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":329345},"main":"./dist/index.js","type":"module","_from":"file:aphexcms-auth-0.1.0.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./schema/pg":{"types":"./dist/schema/pg.d.ts","import":"./dist/schema/pg.js","default":"./dist/schema/pg.js"},"./schema/sqlite":{"types":"./dist/schema/sqlite.d.ts","import":"./dist/schema/sqlite.js","default":"./dist/schema/sqlite.js"}},"scripts":{"build":"tsc","dev:local":"node ../../scripts/swap-package-paths.js ./package.json src"},"_npmUser":{"name":"rainbowasian96","email":"benjaminsinidol@gmail.com"},"_resolved":"/private/var/folders/lg/xjmlrfd55zd3z62k81158q200000gn/T/46957ad7d3cac771e7f71ea3bb4d0a23/aphexcms-auth-0.1.0.tgz","_integrity":"sha512-fqquwGaswYkdYOA2hdGEbNVOl/wKqkKjPOpAo2s6GCd8fJbrW0uCL7xztLwTDJkUyIFbeWeEy49oPRqTzLEt+g==","repository":{"url":"git+https://github.com/IcelandicIcecream/aphex.git","type":"git","directory":"packages/auth"},"_npmVersion":"11.12.1","directories":{},"_nodeVersion":"26.0.0","dependencies":{"@aphexcms/cms-core":"^9.8.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.3","better-auth":"^1.6.25","drizzle-orm":"^0.45.2","@aphexcms/cms-core":"^9.8.1","@better-auth/api-key":"^1.6.25"},"peerDependencies":{"better-auth":"^1.6.25","drizzle-orm":"^0.45.2","@aphexcms/cms-core":"^9.8.1","@better-auth/api-key":"^1.6.25"},"_npmOperationalInternal":{"tmp":"tmp/auth_0.1.0_1786280607089_0.3056637367721009","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@aphexcms/auth","version":"0.2.0","license":"MIT","_id":"@aphexcms/auth@0.2.0","maintainers":[{"name":"rainbowasian96","email":"benjaminsinidol@gmail.com"}],"homepage":"https://github.com/IcelandicIcecream/aphex#readme","bugs":{"url":"https://github.com/IcelandicIcecream/aphex/issues"},"dist":{"shasum":"8db4de71ff8400f1398dc09429037d39684b2593","tarball":"https://registry.npmjs.org/@aphexcms/auth/-/auth-0.2.0.tgz","fileCount":34,"integrity":"sha512-/vQor918sCEgZwZf6sXj4pO5pWG8Ff1t76OcQCZB+/ET9lmjC7rr6mOC9CXLSQGz30NfWPM9Cpi/NYa4sac7hw==","signatures":[{"sig":"MEQCIEbGA2sVqd9Amx2P+OmBfNg/U7DwvqL8cgT9Uq+/meUJAiAY++CCp4wZI/ZZVqmysUsYJVIRQkM6f1Yr/5AnY7ecaQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aphexcms%2fauth@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":311273},"main":"./dist/index.js","type":"module","_from":"file:aphexcms-auth-0.2.0.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./schema/pg":{"types":"./dist/schema/pg.d.ts","import":"./dist/schema/pg.js","default":"./dist/schema/pg.js"},"./schema/sqlite":{"types":"./dist/schema/sqlite.d.ts","import":"./dist/schema/sqlite.js","default":"./dist/schema/sqlite.js"}},"scripts":{"build":"tsc","dev:local":"node ../../scripts/swap-package-paths.js ./package.json src"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:daf265b3-351f-4e46-a524-4ce6da11f489"}},"_resolved":"/tmp/dbdfedf3a3dfaa0d3a1b122de38c23a5/aphexcms-auth-0.2.0.tgz","_integrity":"sha512-/vQor918sCEgZwZf6sXj4pO5pWG8Ff1t76OcQCZB+/ET9lmjC7rr6mOC9CXLSQGz30NfWPM9Cpi/NYa4sac7hw==","repository":{"url":"git+https://github.com/IcelandicIcecream/aphex.git","type":"git","directory":"packages/auth"},"_npmVersion":"11.16.0","directories":{},"_nodeVersion":"24.18.0","dependencies":{"@aphexcms/cms-core":"^9.9.0"},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.3","better-auth":"^1.6.25","drizzle-orm":"^0.45.2","@aphexcms/cms-core":"^9.9.0","@better-auth/api-key":"^1.6.25"},"peerDependencies":{"better-auth":"^1.6.25","drizzle-orm":"^0.45.2","@aphexcms/cms-core":"^9.9.0","@better-auth/api-key":"^1.6.25"},"_npmOperationalInternal":{"tmp":"tmp/auth_0.2.0_1786287385519_0.7497043961318299","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@aphexcms/auth","version":"0.2.1","license":"MIT","_id":"@aphexcms/auth@0.2.1","maintainers":[{"name":"rainbowasian96","email":"benjaminsinidol@gmail.com"}],"homepage":"https://github.com/IcelandicIcecream/aphex#readme","bugs":{"url":"https://github.com/IcelandicIcecream/aphex/issues"},"dist":{"shasum":"462f4997980ca59a0d174ac09ae77775c564f146","tarball":"https://registry.npmjs.org/@aphexcms/auth/-/auth-0.2.1.tgz","fileCount":35,"integrity":"sha512-xTJQqWZE7U9tDb7du5koLrQhJpeDqcetq/z497F2eUmW4mKgToXLvshWXrdIG4l4CT7gKc0F2BzJZKXYztNA/g==","signatures":[{"sig":"MEYCIQDB2wmksPs/zl+DquHfrEoqi9xWRUcjaIhYko5Gvtgc1AIhAK8Hndi8tZ6vuOVQ9bEWfsVFJsYjwwom7WJ/gTRMGLYV","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aphexcms%2fauth@0.2.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":313766},"main":"./dist/index.js","type":"module","_from":"file:aphexcms-auth-0.2.1.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./schema/pg":{"types":"./dist/schema/pg.d.ts","import":"./dist/schema/pg.js","default":"./dist/schema/pg.js"},"./schema/sqlite":{"types":"./dist/schema/sqlite.d.ts","import":"./dist/schema/sqlite.js","default":"./dist/schema/sqlite.js"}},"scripts":{"build":"tsc","dev:local":"node ../../scripts/swap-package-paths.js ./package.json src"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:daf265b3-351f-4e46-a524-4ce6da11f489"}},"_resolved":"/tmp/df89d229571405cd426bfd3016f61688/aphexcms-auth-0.2.1.tgz","_integrity":"sha512-xTJQqWZE7U9tDb7du5koLrQhJpeDqcetq/z497F2eUmW4mKgToXLvshWXrdIG4l4CT7gKc0F2BzJZKXYztNA/g==","repository":{"url":"git+https://github.com/IcelandicIcecream/aphex.git","type":"git","directory":"packages/auth"},"_npmVersion":"11.19.1","description":"[Better Auth](https://better-auth.com) wiring for [AphexCMS](https://github.com/IcelandicIcecream/aphex), in one call.","directories":{},"_nodeVersion":"24.20.0","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.3","better-auth":"^1.6.25","drizzle-orm":"^0.45.2","@aphexcms/cms-core":"^11.0.0","@better-auth/api-key":"^1.6.25"},"peerDependencies":{"better-auth":"^1.6.25","drizzle-orm":"^0.45.2","@aphexcms/cms-core":">=11.0.0","@better-auth/api-key":"^1.6.25"},"_npmOperationalInternal":{"tmp":"tmp/auth_0.2.1_1788805979097_0.21412768710098096","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@aphexcms/auth","version":"0.2.2","license":"MIT","publishConfig":{"access":"public","provenance":true},"repository":{"type":"git","url":"git+https://github.com/IcelandicIcecream/aphex.git","directory":"packages/auth"},"type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./schema/pg":{"types":"./dist/schema/pg.d.ts","import":"./dist/schema/pg.js","default":"./dist/schema/pg.js"},"./schema/sqlite":{"types":"./dist/schema/sqlite.d.ts","import":"./dist/schema/sqlite.js","default":"./dist/schema/sqlite.js"}},"peerDependencies":{"@aphexcms/cms-core":">=11.2.0","@better-auth/api-key":"^1.6.25","better-auth":"^1.6.25","drizzle-orm":"^0.45.2"},"devDependencies":{"@better-auth/api-key":"^1.6.25","better-auth":"^1.6.25","drizzle-orm":"^0.45.2","typescript":"^5.9.3","@aphexcms/cms-core":"^11.2.0"},"scripts":{"build":"tsc","dev:local":"node ../../scripts/swap-package-paths.js ./package.json src"},"_id":"@aphexcms/auth@0.2.2","description":"[Better Auth](https://better-auth.com) wiring for [AphexCMS](https://github.com/IcelandicIcecream/aphex), in one call.","bugs":{"url":"https://github.com/IcelandicIcecream/aphex/issues"},"homepage":"https://github.com/IcelandicIcecream/aphex#readme","_integrity":"sha512-VjTei3/wdZ9jtPQTxlvzIdku/pAQtGUsOKaAHoUeFObBO5OqURvWuzExDeR02m6DI7jsa0IkwBui91kmE8thFg==","_resolved":"/tmp/9d672925c1213c7fd1955ceb018ca222/aphexcms-auth-0.2.2.tgz","_from":"file:aphexcms-auth-0.2.2.tgz","_nodeVersion":"24.20.0","_npmVersion":"11.19.1","dist":{"integrity":"sha512-VjTei3/wdZ9jtPQTxlvzIdku/pAQtGUsOKaAHoUeFObBO5OqURvWuzExDeR02m6DI7jsa0IkwBui91kmE8thFg==","shasum":"96deda4f09436a233d4d1609c619439e1e1fe347","tarball":"https://registry.npmjs.org/@aphexcms/auth/-/auth-0.2.2.tgz","fileCount":35,"unpackedSize":317076,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aphexcms%2fauth@0.2.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFCo/L80n+nZo5ejml3trvV4vf3AgAx5Ma8SJ3PufGjmAiEAw9aD8bkKMYFEKYIexOKdiCNl4rrZCDzmTNtiCCE72Qg="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:daf265b3-351f-4e46-a524-4ce6da11f489"}},"directories":{},"maintainers":[{"name":"rainbowasian96","email":"benjaminsinidol@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/auth_0.2.2_1789386860248_0.6633621971096095"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-09T13:03:26.918Z","modified":"2026-09-14T11:54:20.734Z","0.1.0":"2026-08-09T13:03:27.266Z","0.2.0":"2026-08-09T14:56:25.656Z","0.2.1":"2026-09-07T18:32:59.233Z","0.2.2":"2026-09-14T11:54:20.371Z"},"bugs":{"url":"https://github.com/IcelandicIcecream/aphex/issues"},"license":"MIT","homepage":"https://github.com/IcelandicIcecream/aphex#readme","repository":{"type":"git","url":"git+https://github.com/IcelandicIcecream/aphex.git","directory":"packages/auth"},"description":"[Better Auth](https://better-auth.com) wiring for [AphexCMS](https://github.com/IcelandicIcecream/aphex), in one call.","maintainers":[{"name":"rainbowasian96","email":"benjaminsinidol@gmail.com"}],"readme":"# @aphexcms/auth\n\n[Better Auth](https://better-auth.com) wiring for [AphexCMS](https://github.com/IcelandicIcecream/aphex), in one call.\n\nAphex is auth-agnostic — `cms-core` defines an `AuthProvider` port and doesn't care what implements it. This package is the batteries-included implementation: sessions, organizations, invitations, API keys, two-factor, and the email flows, already mapped onto Aphex's capability model.\n\n📚 **Documentation: [docs.getaphex.com/authentication](https://docs.getaphex.com/authentication)**\n\n## Install\n\n```bash\npnpm add @aphexcms/auth better-auth @better-auth/api-key\n```\n\n## Quick start\n\n```ts title=\"src/lib/server/auth/index.ts\"\nimport { createAphexAuth } from '@aphexcms/auth';\nimport { db, drizzleDb, dbDialect } from '$lib/server/db';\nimport { email } from '$lib/server/email';\n\nexport const {\n\tauth,\n\tservice: authService,\n\tprovider: authProvider\n} = createAphexAuth({\n\tdatabase: db,\n\tdrizzleDb,\n\tdialect: dbDialect,\n\tsecret: env.AUTH_SECRET,\n\tbaseURL: env.AUTH_URL,\n\ttrustedOrigins: [env.AUTH_URL],\n\temailAdapter: email,\n\tappName: 'My CMS'\n});\n```\n\n`provider` is what `createCMSConfig()` wants:\n\n```ts title=\"aphex.config.ts\"\nexport default createCMSConfig({\n\tschemaTypes,\n\tdatabase: db,\n\tauth: { provider: authProvider, loginUrl: '/login' }\n});\n```\n\n## Environment\n\n```bash\nAUTH_SECRET=            # node -e \"console.log(require('crypto').randomBytes(32).toString('base64url'))\"\nAUTH_URL=http://localhost:5173\nAUTH_TRUSTED_ORIGINS=http://localhost:5173\n```\n\n`BETTER_AUTH_SECRET` / `BETTER_AUTH_URL` still work as aliases, but prefer the `AUTH_*` spellings.\n\nRotating `AUTH_SECRET` signs everyone out and invalidates every API key, so generate one per environment and keep it.\n\n`AUTH_TRUSTED_ORIGINS` is not optional in production: Better Auth uses it for CSRF and origin checks, and without it cookie-authenticated mutations are reachable from any site a signed-in admin visits.\n\n## Schema\n\nAuth tables are dialect-specific and exported separately, because Drizzle needs the real table objects:\n\n```ts\nimport * as authSchema from '@aphexcms/auth/schema/pg'; // or /schema/sqlite\n```\n\n## Email verification is off by default\n\nThe first user to sign up becomes super admin and can sign in immediately, with no SMTP server — which is what makes a fresh project runnable in one command. Turn verification on with `AUTH_REQUIRE_EMAIL_VERIFICATION=true` once you have an email adapter configured. In production you want it on: without it, anyone can sign up with an address they don't own.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}