{"id":26822,"library":"cby-auth","title":"cby-auth","description":"CodeBy React auth wrapper & components providing authentication UI and logic for React applications using Apollo Client and GraphQL. The latest version is 1.1.53, with moderate release activity. It integrates with apollo-boost, react-apollo, lodash, and prop-types. Unlike generic auth libraries, it provides ready-to-use components like CBYAuthScreen that handle authentication flows with GraphQL backends.","status":"active","version":"1.1.53","language":"javascript","source_language":"en","source_url":"https://github.com/JNussens/cby-auth","tags":["javascript"],"install":[{"cmd":"npm install cby-auth","lang":"bash","label":"npm"},{"cmd":"yarn add cby-auth","lang":"bash","label":"yarn"},{"cmd":"pnpm add cby-auth","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency for Apollo Client setup","package":"apollo-boost","optional":false},{"reason":"Peer dependency for GraphQL queries","package":"graphql","optional":false},{"reason":"Peer dependency for utility functions","package":"lodash","optional":false},{"reason":"Peer dependency for runtime type checking","package":"prop-types","optional":false},{"reason":"Peer dependency for React components","package":"react","optional":false},{"reason":"Peer dependency for Apollo bindings","package":"react-apollo","optional":false},{"reason":"Peer dependency for DOM rendering","package":"react-dom","optional":false}],"imports":[{"note":"CBYAuthScreen is a named export, not default.","wrong":"import CBYAuthScreen from 'cby-auth'","symbol":"CBYAuthScreen","correct":"import { CBYAuthScreen } from 'cby-auth'"},{"note":"ESM import recommended; CommonJS require also works.","wrong":"const CBYAuthContext = require('cby-auth').CBYAuthContext","symbol":"CBYAuthContext","correct":"import { CBYAuthContext } from 'cby-auth'"},{"note":"cbyAuth is a named export.","wrong":"import cbyAuth from 'cby-auth'","symbol":"cbyAuth","correct":"import { cbyAuth } from 'cby-auth'"}],"quickstart":{"code":"import React from 'react';\nimport { CBYAuthScreen } from 'cby-auth';\n\nfunction App() {\n  return <CBYAuthScreen />;\n}\n\nexport default App;","lang":"javascript","description":"Minimal setup: render the CBYAuthScreen component to display authentication form."},"warnings":[{"fix":"Install all peer dependencies manually: npm install apollo-boost graphql lodash prop-types react react-apollo react-dom","message":"Package requires peer dependencies: apollo-boost, graphql, lodash, prop-types, react, react-apollo, react-dom. Missing them causes runtime errors.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Wrap your app with <ApolloProvider client={client}> before using any cby-auth components.","message":"CBYAuthScreen and other components expect an Apollo Client context via react-apollo; not wrapping the app with ApolloProvider will cause errors.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Check the package name on npm: 'cby-auth' (this one) vs 'cby-auth2'.","message":"Package name 'cby-auth' might be confused with 'cby-auth2' or alternative versions; ensure using the correct package.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"npm install apollo-boost","cause":"Missing peer dependency apollo-boost","error":"Module not found: Can't resolve 'apollo-boost'"},{"fix":"Wrap component tree with <ApolloProvider client={client}>","cause":"Apollo client not provided via ApolloProvider","error":"TypeError: Cannot read property 'query' of undefined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}