{"_id":"@abrclick/auth-js","_rev":"4-910eb04a1d871e6cd3dd9f09b7b1296d","name":"@abrclick/auth-js","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@abrclick/auth-js","version":"0.1.0","keywords":["abrclick","auth","authentication","jwt","otp","gotrue","supabase","iran"],"author":{"url":"https://abrclick.ir","name":"Abrclick","email":"support@abrclick.ir"},"license":"SEE LICENSE IN LICENSE","_id":"@abrclick/auth-js@0.1.0","maintainers":[{"name":"mahyargdz","email":"mahyar.goudarzi1998@gmail.com"}],"homepage":"https://abrclick.ir","dist":{"shasum":"facf1069408d420b9a196112fb0d69373e57b583","tarball":"https://registry.npmjs.org/@abrclick/auth-js/-/auth-js-0.1.0.tgz","fileCount":9,"integrity":"sha512-G7JU/1YBkePb7Ep41oO9fEpm3NJ9CRKPmqYlrjGGqdGdL32QewL5kKM2Uhnj+r0gcIe/suzPMct9s48ocIdAEw==","signatures":[{"sig":"MEYCIQC59vebuoL4chZ7blQ47wHri3xgxixbe3iH8lqJVcEoOgIhAJhBbqwZBpxYsAy8oeg8ofick+3gX/c8V2S77zQhee4K","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":22743},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"gitHead":"3eb595f649cd1a0a9c58d488f8469019f3487bfc","private":false,"scripts":{"build":"tsc","type-check":"tsc --noEmit"},"_npmUser":{"name":"mahyargdz","email":"mahyar.goudarzi1998@gmail.com"},"_npmVersion":"11.12.1","description":"Supabase/GoTrue-shaped auth client for Abrclick Auth-as-a-Service — sign in your own app's end-users","directories":{},"_nodeVersion":"24.15.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.3"},"_npmOperationalInternal":{"tmp":"tmp/auth-js_0.1.0_1784206277561_0.17842924101944657","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@abrclick/auth-js","version":"0.1.1","keywords":["abrclick","auth","authentication","jwt","otp","gotrue","supabase","iran"],"author":{"url":"https://abrclick.ir","name":"Abrclick","email":"support@abrclick.ir"},"license":"SEE LICENSE IN LICENSE","_id":"@abrclick/auth-js@0.1.1","maintainers":[{"name":"mahyargdz","email":"mahyar.goudarzi1998@gmail.com"}],"homepage":"https://abrclick.ir","dist":{"shasum":"a4585655954a4dfa52824039b5bb776b9b975255","tarball":"https://registry.npmjs.org/@abrclick/auth-js/-/auth-js-0.1.1.tgz","fileCount":9,"integrity":"sha512-DH1tmtS3pI3w9x54TyibBJaJy/5wZG8NAu8BbYaVhPdrqvX5RsXxyVTkwK4VBS6Pgnnco1aTOnQSwfO+d8Ki6A==","signatures":[{"sig":"MEQCIBx44k70MBVuzwcD/6BsfyBONFNkbaJVAEqTO3H6jLRbAiAqKGSFVdHj3vHtMkDDPuLDiFEz+yiLvdqhxez9PK0j5A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":22835},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"gitHead":"dbe18f7e25dad11d4a6951aadc2e800a5049492a","private":false,"scripts":{"build":"tsc","type-check":"tsc --noEmit"},"_npmUser":{"name":"mahyargdz","email":"mahyar.goudarzi1998@gmail.com"},"_npmVersion":"10.9.8","description":"Supabase/GoTrue-shaped auth client for Abrclick Auth-as-a-Service — sign in your own app's end-users","directories":{},"_nodeVersion":"22.23.1","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.3"},"_npmOperationalInternal":{"tmp":"tmp/auth-js_0.1.1_1784283977883_0.9256671576806759","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@abrclick/auth-js","version":"0.1.2","keywords":["abrclick","auth","authentication","jwt","otp","gotrue","supabase","iran"],"author":{"url":"https://abrclick.ir","name":"Abrclick","email":"support@abrclick.ir"},"license":"SEE LICENSE IN LICENSE","_id":"@abrclick/auth-js@0.1.2","maintainers":[{"name":"mahyargdz","email":"mahyar.goudarzi1998@gmail.com"}],"homepage":"https://abrclick.ir","dist":{"shasum":"70780ed23823a920a3006edea591f14b1a6c6bf1","tarball":"https://registry.npmjs.org/@abrclick/auth-js/-/auth-js-0.1.2.tgz","fileCount":9,"integrity":"sha512-57OMCsyvrQu6DNLIsKlGTQHvYIKEhRn8wBWYqzBqZ4UoVEsU96OFys8INOPzt0fNf/q0ggIjwSB0mQOhtX0jgg==","signatures":[{"sig":"MEUCIQDhEwvdK63qnOSnwIm+u3ly+0hcMjSi0EgJZZl9lIg0FQIgN8r34MrXHquu8jaAuB+jz1uqqX9dh1OfICpqB3ph0kg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":23785},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"gitHead":"2595fa0e0edc0cf648ac8faf9ce34953631db01f","private":false,"scripts":{"build":"tsc","type-check":"tsc --noEmit","release:first":"git tag -a v$npm_package_version -m v$npm_package_version && git push origin main --follow-tags","release:major":"npm version major && git push --follow-tags","release:minor":"npm version minor && git push --follow-tags","release:patch":"npm version patch && git push --follow-tags","prepublishOnly":"npm run build"},"_npmUser":{"name":"mahyargdz","email":"mahyar.goudarzi1998@gmail.com"},"_npmVersion":"10.9.8","description":"Supabase/GoTrue-shaped auth client for Abrclick Auth-as-a-Service — sign in your own app's end-users","directories":{},"_nodeVersion":"22.23.1","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.3"},"_npmOperationalInternal":{"tmp":"tmp/auth-js_0.1.2_1785165290073_0.8380407568288069","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@abrclick/auth-js","version":"0.2.0","description":"Supabase/GoTrue-shaped auth client for Abrclick Auth-as-a-Service — sign in your own app's end-users","private":false,"license":"SEE LICENSE IN LICENSE","author":{"name":"Abrclick","email":"support@abrclick.cloud","url":"https://abrclick.ir"},"homepage":"https://abrclick.ir","keywords":["abrclick","auth","authentication","jwt","otp","gotrue","supabase","iran"],"type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"engines":{"node":">=18"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"scripts":{"build":"tsc","type-check":"tsc --noEmit","prepublishOnly":"npm run build","release:first":"git tag -a v$npm_package_version -m v$npm_package_version && git push origin main --follow-tags","release:patch":"npm version patch && git push --follow-tags","release:minor":"npm version minor && git push --follow-tags","release:major":"npm version major && git push --follow-tags"},"devDependencies":{"typescript":"^5.7.3"},"_id":"@abrclick/auth-js@0.2.0","gitHead":"ec0e6a5516b04159ebfd4762b7d595b3d8665c2a","_nodeVersion":"22.23.2","_npmVersion":"10.9.8","dist":{"integrity":"sha512-ysuaKPtT6JV5gjz7QiJuS3o02Jz3Er2O2YVTo7JMVq5OriblaD14++53Xwvunz4D1UvrCI7Cu5So8H8qKozyUw==","shasum":"efac9cf93c95f34201ba4a84d296080940969f39","tarball":"https://registry.npmjs.org/@abrclick/auth-js/-/auth-js-0.2.0.tgz","fileCount":9,"unpackedSize":23791,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQC2cMn+x9rzdxIVCFGFjXwG31XDh6zhUeo4pbd6akPzTgIhAJVK5jX5CO0q3GJm7oQG1sDPZ0V7mNW8g382evVv4v7E"}]},"_npmUser":{"name":"mahyargdz","email":"mahyar.goudarzi1998@gmail.com"},"directories":{},"maintainers":[{"name":"mahyargdz","email":"mahyar.goudarzi1998@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/auth-js_0.2.0_1786953957607_0.5473612633985256"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-16T12:51:17.343Z","modified":"2026-08-17T08:05:57.940Z","0.1.0":"2026-07-16T12:51:17.694Z","0.1.1":"2026-07-17T10:26:18.011Z","0.1.2":"2026-07-27T15:14:50.238Z","0.2.0":"2026-08-17T08:05:57.766Z"},"author":{"name":"Abrclick","email":"support@abrclick.cloud","url":"https://abrclick.ir"},"license":"SEE LICENSE IN LICENSE","homepage":"https://abrclick.ir","keywords":["abrclick","auth","authentication","jwt","otp","gotrue","supabase","iran"],"description":"Supabase/GoTrue-shaped auth client for Abrclick Auth-as-a-Service — sign in your own app's end-users","maintainers":[{"name":"mahyargdz","email":"mahyar.goudarzi1998@gmail.com"}],"readme":"# @abrclick/auth-js\n\nSupabase/GoTrue-shaped auth client for **[Abrclick](https://abrclick.ir) Auth-as-a-Service**.\nSign in your own app's end-users — email/password, phone & email OTP, password recovery —\nagainst your project's hosted auth service. Zero dependencies (native `fetch`); works in the\nbrowser, Node 18+, and edge runtimes.\n\n## Products\n\n- [استقرار اپلیکیشن (PaaS)](https://abrclick.ir/paas) — deploy Node.js, Python, Go, PHP & Docker apps\n- [دیتابیس مدیریت‌شده (DBaaS)](https://abrclick.ir/databases) — managed PostgreSQL, Redis, MongoDB, MySQL\n- [فضای ذخیره‌سازی ابری (Object Storage)](https://abrclick.ir/object-storage) — S3-compatible buckets\n- [توابع بدون سرور (Serverless)](https://abrclick.ir/serverless) — run functions without managing servers\n- [همه‌ی محصولات](https://abrclick.ir/products)\n\n```bash\nnpm install @abrclick/auth-js\n```\n\n## Quick start\n\n```ts\nimport { createAuthClient } from \"@abrclick/auth-js\";\n\nconst auth = createAuthClient({\n  url: \"https://auth.abrclick.ir\",   // your cell's auth host (no /v1)\n  publicKey: \"pk_cell-1_…\",          // your project's public key (from the console)\n});\n\n// email + password\nconst { data, error } = await auth.signInWithPassword({ email, password });\nif (error) console.error(error.code, error.messageFa);\nelse console.log(data.user, data.access_token);\n\n// passwordless (phone SMS or email)\nawait auth.signInWithOtp({ phone: \"09121234567\" });\nconst res = await auth.verifyOtp({ phone: \"09121234567\", code: \"123456\" });\n\n// password reset\nawait auth.resetPasswordForEmail(email);            // sends a recovery code\nawait auth.verifyOtp({ email, code, type: \"recovery\" }); // → a session\nawait auth.updateUser({ password: \"newPassword\" });      // set the new one\n```\n\nThe client persists the session (localStorage in the browser by default) and exposes\n`getSession()` / `getAccessToken()` synchronously — attach the access token to your own\nAPI as `Authorization: Bearer <token>`.\n\n## Verifying tokens on your backend\n\nVerify our JWTs **offline** against your project's JWKS — no call to us per request:\n\n```ts\nimport { jwtVerify, createRemoteJWKSet } from \"jose\";\nconst JWKS = createRemoteJWKSet(\n  new URL(\"https://auth.abrclick.ir/v1/pk_cell-1_…/.well-known/jwks.json\"),\n);\nconst { payload } = await jwtVerify(token, JWKS);   // payload.sub = your user's id\n```\n\n## API\n\n| Method | Endpoint |\n|---|---|\n| `signUp({ email, password })` | `POST /signup` |\n| `signInWithPassword({ email, password })` | `POST /token?grant_type=password` |\n| `signInWithOtp({ phone \\| email })` | `POST /otp` |\n| `verifyOtp({ phone \\| email, code, type? })` | `POST /verify` |\n| `resend({ type, phone?, email? })` | `POST /resend` |\n| `resetPasswordForEmail(email)` | `POST /recover` |\n| `refreshSession()` | `POST /token?grant_type=refresh_token` |\n| `getUser()` | `GET /user` |\n| `updateUser({ email?, phone?, password?, data? })` | `PUT /user` |\n| `signOut(scope?)` | `POST /logout` |\n| `getSettings()` | `GET /settings` |\n\nEvery method resolves `{ data, error }` — it never throws on an API error. `error` is an\n`AuthError` with a stable `.code`, an English `.message`, and a Farsi `.messageFa`.\n\n`onAuthStateChange((event, session) => …)` fires on `SIGNED_IN` / `SIGNED_OUT` /\n`TOKEN_REFRESHED` / `USER_UPDATED`.\n\n## Storage\n\nDefaults to `localStorage` in the browser, in-memory elsewhere. Override for React\nNative / SSR:\n\n```ts\ncreateAuthClient({ url, publicKey, storage: myAsyncStorageAdapter });\ncreateAuthClient({ url, publicKey, storage: null }); // no persistence\n```\n","readmeFilename":"README.md"}