Registry / auth-security / cby-auth

cby-auth

JSON →
library1.1.53jsnpmunverified

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.

npm install cby-auth
INSTALL
IMPORT
SIG · CBY-AUTH
C
cby-auth
auth-securityjavascriptv1.1.53
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

CBYAuthScreen
import { CBYAuthScreen } from 'cby-auth'
import CBYAuthScreen from 'cby-auth'
CBYAuthScreen is a named export, not default.
CBYAuthContext
import { CBYAuthContext } from 'cby-auth'
const CBYAuthContext = require('cby-auth').CBYAuthContext
ESM import recommended; CommonJS require also works.
cbyAuth
import { cbyAuth } from 'cby-auth'
import cbyAuth from 'cby-auth'
cbyAuth is a named export.

Minimal setup: render the CBYAuthScreen component to display authentication form.

import React from 'react'; import { CBYAuthScreen } from 'cby-auth'; function App() { return <CBYAuthScreen />; } export default App;
Debug
Known issues
gotchaPackage requires peer dependencies: apollo-boost, graphql, lodash, prop-types, react, react-apollo, react-dom. Missing them causes runtime errors.
fix
Install all peer dependencies manually: npm install apollo-boost graphql lodash prop-types react react-apollo react-dom
affects: >=1.0.0
gotchaCBYAuthScreen and other components expect an Apollo Client context via react-apollo; not wrapping the app with ApolloProvider will cause errors.
fix
Wrap your app with <ApolloProvider client={client}> before using any cby-auth components.
affects: >=1.0.0
gotchaPackage name 'cby-auth' might be confused with 'cby-auth2' or alternative versions; ensure using the correct package.
fix
Check the package name on npm: 'cby-auth' (this one) vs 'cby-auth2'.
affects: >=1.0.0
Errors
Common errors & fixes
Module not found: Can't resolve 'apollo-boost'
Missing peer dependency apollo-boost
fix
npm install apollo-boost
TypeError: Cannot read property 'query' of undefined
Apollo client not provided via ApolloProvider
fix
Wrap component tree with <ApolloProvider client={client}>
Upgrade
Version history
1.1.53latest on npm
Audit
Dependencies
apollo-boostrequiredPeer dependency for Apollo Client setup
graphqlrequiredPeer dependency for GraphQL queries
lodashrequiredPeer dependency for utility functions
prop-typesrequiredPeer dependency for runtime type checking
reactrequiredPeer dependency for React components
react-apollorequiredPeer dependency for Apollo bindings
react-domrequiredPeer dependency for DOM rendering
Agent activity
12 hits · last 30 days
node
10
OpenAI (training)
1
Resources
cby-auth — npm install cby-auth · libregistry