{"_id":"@bastaai/ory-kratos-react-hooks","_rev":"5-bd591e933b3246dd1b76c431661da6c8","name":"@bastaai/ory-kratos-react-hooks","dist-tags":{"latest":"0.0.0-alpha.0"},"versions":{"0.0.0-alpha.0":{"name":"@bastaai/ory-kratos-react-hooks","version":"0.0.0-alpha.0","keywords":[],"author":"","license":"UNLICENSED","_id":"@bastaai/ory-kratos-react-hooks@0.0.0-alpha.0","maintainers":[{"name":"einarlogi","email":"einar.hreinsson@basta.ai"},{"name":"viktorbasta","email":"viktor.blondal@basta.ai"}],"dist":{"shasum":"7c981c566ac43c31f6a52c37fddc9a2351b0989a","tarball":"https://registry.npmjs.org/@bastaai/ory-kratos-react-hooks/-/ory-kratos-react-hooks-0.0.0-alpha.0.tgz","fileCount":6,"integrity":"sha512-C3WjslStpEdSyOGIMo71oWoJpJm9F9idhEBqNCXewZ13ee2f1X/gb6aDnD0g5GFwMZUwIe1vhsC8uq04hLWTzQ==","signatures":[{"sig":"MEUCIQCWTFvdPDiac35RECbeD139p8+rsE8QcDWq6vU9CAeyywIgacQoM7R5YAd7bwjXwRaT/S8FaD6BxM1IXHmo7JrFtEI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":757740},"main":"dist/index.js","types":"types/index.d.ts","module":"dist/index.esm.js","gitHead":"b2a6ad73d76bef40af06a884410f8e009c9abfc5","scripts":{"lint":"eslint '{src,types}/**/*.ts' && prettier './**/*.{ts,md,html,css}' --check","test":"npm run lint && npm run test:unit && tsc","build":"npm run clean && rollup --bundleConfigAsCjs -c","clean":"rimraf dist","debug":"nodemon -e ts --watch src --exec \"npm run build\"","lint:fix":"eslint '{src,types}/**/*.ts' --fix && prettier './**/*.{ts,md,html,css}' --write","prettier":"prettier './**/*.{js,ts,md,html,css}' --write","test:unit":"jest --verbose","prettier-check":"prettier './**/*.{js,ts,md,html,css}' --check"},"typings":"types/index.d.ts","_npmUser":{"name":"viktorbasta","email":"viktor.blondal@basta.ai"},"_npmVersion":"10.5.0","description":"<img src=\"https://gist.githubusercontent.com/viktorbasta/d60b2555b30c415c8da7f4cc91282a7e/raw/84debc03b126793c193f40010388b1855aec1ad4/basta-labs-logo-horizontal.png\" height=\"120\" />","directories":{},"jsnext:main":"dist/index.esm.js","_nodeVersion":"18.20.2","dependencies":{"next":"^14.2.2","react":"^18.2.0","@mui/joy":"^5.0.0-beta.32","@ory/client":"^1.9.0","@emotion/react":"^11.11.4","@emotion/styled":"^11.11.5","react-router-dom":"^6.22.3"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","dotenv":"^16.0.3","eslint":"^8.39.0","rimraf":"^5.0.0","rollup":"^3.28.1","graphql":"^16.6.0","nodemon":"^3.0.1","ts-node":"^10.9.1","prettier":"^2.8.8","typescript":"^5.0.4","@types/jest":"^29.5.12","@types/react":"^18.2.78","@babel/preset-env":"^7.24.4","eslint-plugin-jest":"^27.2.1","@babel/preset-react":"^7.24.1","@rollup/plugin-babel":"^6.0.3","eslint-plugin-import":"^2.27.5","@testing-library/react":"^15.0.2","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^4.2.1","jest-environment-jsdom":"^29.7.0","@babel/preset-typescript":"^7.24.1","@typescript-eslint/parser":"^5.59.2","rollup-plugin-typescript2":"^0.35.0","@rollup/plugin-node-resolve":"^15.2.3","@typescript-eslint/eslint-plugin":"^5.59.2","@babel/plugin-transform-modules-commonjs":"^7.24.1"},"_npmOperationalInternal":{"tmp":"tmp/ory-kratos-react-hooks_0.0.0-alpha.0_1715350663888_0.744192675290676","host":"s3://npm-registry-packages"}}},"time":{"created":"2024-05-10T14:17:43.801Z","modified":"2025-10-21T10:32:15.855Z","0.0.0-alpha.0":"2024-05-10T14:17:44.107Z"},"license":"UNLICENSED","keywords":[],"description":"<img src=\"https://gist.githubusercontent.com/viktorbasta/d60b2555b30c415c8da7f4cc91282a7e/raw/84debc03b126793c193f40010388b1855aec1ad4/basta-labs-logo-horizontal.png\" height=\"120\" />","maintainers":[{"email":"sara@basta.app","name":"sarabasta"},{"email":"einar.hreinsson@basta.ai","name":"einarlogi"},{"email":"reginbaldur@gmail.com","name":"reginbald"},{"email":"haukur@gangverk.is","name":"haukurk"},{"email":"steinar@gangverk.is","name":"steinara"}],"readme":"<img src=\"https://gist.githubusercontent.com/viktorbasta/d60b2555b30c415c8da7f4cc91282a7e/raw/84debc03b126793c193f40010388b1855aec1ad4/basta-labs-logo-horizontal.png\" height=\"120\" />\n\n# Ory Kratos React Hooks\n\nCollection of convenient hooks for working with Ory Kratos, identity and user\nmanagement system.\n\n## Hooks\n\n- `useFlow`: This hook allows you to easily manage authentication flows in your\n  React applications.\n- `useSession`: Use this hook to access and manage user sessions with Ory\n  Kratos.\n\n## Examples\n\n### useFlow\n\n- `flowType`: login | registration | recovery | settings | verification\n- `render` keys: input | a | img | text | script. Components are uncontrolled\n  and submitted via form.\n\n```typescript\nconst { html, return_to } = useFlow({\n  flowType: 'login',\n  options: {\n    render: {\n      input: ({ meta, props }) => {\n        if (props.type === 'submit') {\n          return <Button {...props}>{meta.label?.text}</Button>;\n        }\n\n        return <input {...props} />;\n      },\n      a: () => {...},\n      img: () => {...},\n      text: () => {...},\n      script: () => {...},\n    },\n  },\n})\n```\n","readmeFilename":"readme.md"}