{"id":24904,"library":"amplify-auth-hooks","title":"Amplify Auth Hooks","description":"React hooks for AWS Amplify authentication. Version 1.0.0 provides a set of hooks like useAuth, useSignIn, useSignUp, etc., wrapping Amplify Auth operations. Released as a single version with no updates since. Differentiates by offering hook-based API for Amplify Auth, tightly coupled with React lifecycle. Requires @aws-amplify/auth, @aws-amplify/core, amazon-cognito-identity-js, and react as peer dependencies. Ships TypeScript types.","status":"maintenance","version":"1.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/hupe1980/amplify-material-ui","tags":["javascript","react","aws amplify","amplify","hooks","auth","typescript"],"install":[{"cmd":"npm install amplify-auth-hooks","lang":"bash","label":"npm"},{"cmd":"yarn add amplify-auth-hooks","lang":"bash","label":"yarn"},{"cmd":"pnpm add amplify-auth-hooks","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core dependency for Auth API","package":"@aws-amplify/auth","optional":false},{"reason":"Required for configuration","package":"@aws-amplify/core","optional":false},{"reason":"Underlying Cognito library","package":"amazon-cognito-identity-js","optional":false},{"reason":"Peer dependency for hooks","package":"react","optional":false}],"imports":[{"note":"Named export, not default.","wrong":"import useAuth from 'amplify-auth-hooks'","symbol":"useAuth","correct":"import { useAuth } from 'amplify-auth-hooks'"},{"note":"CommonJS require works, but prefer ESM.","wrong":"const { useSignIn } = require('amplify-auth-hooks')","symbol":"useSignIn","correct":"import { useSignIn } from 'amplify-auth-hooks'"},{"note":"Hook name is useSignUp, not SignUp.","wrong":"import { SignUp } from 'amplify-auth-hooks'","symbol":"useSignUp","correct":"import { useSignUp } from 'amplify-auth-hooks'"}],"quickstart":{"code":"import React from 'react';\nimport { useAuth } from 'amplify-auth-hooks';\n\nfunction AuthStatus() {\n  const { user, loading, error } = useAuth();\n\n  if (loading) return <div>Loading...</div>;\n  if (error) return <div>Error: {error.message}</div>;\n  if (user) return <div>Welcome, {user.username}</div>;\n  return <div>Not logged in</div>;\n}\n\nexport default AuthStatus;","lang":"typescript","description":"Shows basic usage of useAuth hook to get authentication state."},"warnings":[{"fix":"Call Amplify.configure() once at app root.","message":"Forgot to configure Amplify before using hooks","severity":"gotcha","affected_versions":"*"},{"fix":"Use loading state to handle asynchronous auth check.","message":"Undefined user on first render","severity":"gotcha","affected_versions":"*"},{"fix":"Upgrade to latest version for hooks support.","message":"Old version only supports class components?","severity":"deprecated","affected_versions":"<=1.0.0"}],"env_vars":null,"search_vec":"'/auth':54 '/core':58 '1.0.0':11 'amazon':60 'amazon-cognito-identity-j':59 'amplifi':1,8,23,43,53,57,75,76 'api':41 'auth':2,24,44,78 'authent':9 'aw':7,52,56,74 'aws-amplifi':51,55 'base':40 'cognito':61 'coupl':46 'depend':68 'differenti':35 'etc':21 'hook':3,5,16,39,77 'hook-bas':38 'ident':62 'javascript':72 'js':63 'lifecycl':49 'like':17 'offer':37 'oper':25 'peer':67 'provid':12 'react':4,48,65,73 'releas':26 'requir':50 'set':14 'ship':69 'sinc':34 'singl':29 'tight':45 'type':71 'typescript':70,79 'updat':33 'useauth':18 'usesignin':19 'usesignup':20 'version':10,30 'wrap':22","created_at":"2026-05-01T13:42:00.890927+00:00","updated_at":"2026-05-01T13:42:00.890927+00:00","problems":[{"fix":"import Amplify from '@aws-amplify/core'; Amplify.configure(awsConfig);","cause":"Amplify not configured or imported","error":"Cannot read property 'amplify' of undefined"},{"fix":"import { useAuth } from 'amplify-auth-hooks';","cause":"Wrong import (default vs named)","error":"TypeError: (0 , _auth.useAuth) is not a function"},{"fix":"Use ES module import syntax.","cause":"Using CommonJS require in browser bundle","error":"Uncaught ReferenceError: require is not defined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/hupe1980/amplify-material-ui","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/amplify-auth-hooks","openapi_spec":null,"status_page":null,"smithery":null,"categories":["aws","auth-security","web-framework"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-05-01","next_check":"2026-07-30","install_tag":null}}