Registry / database / zitejs

zitejs

JSON →
library0.9.34jsnpmunverified

ZiteJS (v0.9.34) is a framework for building apps on Zite Database, providing typed client access, API endpoint creation, authentication, file uploads, PDF generation, and scheduled tasks. It is actively developed with release cadence following GitHub releases. Key differentiators: vibe-coding oriented, full-stack capabilities with React integration (peer deps: @tanstack/react-query >=5, react >=18), and TypeScript-first design. Suitable for rapid prototyping and production apps leveraging the Zite ecosystem.

npm install zitejs
INSTALL
IMPORT
SIG · ZITEJS
Z
zitejs
databasejavascriptv0.9.34
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.

zite
✓ import { zite } from 'zitejs/db'
✗ import { zite } from 'zitejs'
The main client is exported from 'zitejs/db', not the root package.
createEndpoint
✓ import { createEndpoint } from 'zitejs/api'
✗ import createEndpoint from 'zitejs/api'
createEndpoint is a named export from 'zitejs/api'. Default import will fail.
useAuth
✓ import { useAuth } from 'zitejs/auth'
✗ import useAuth from 'zitejs/auth'
useAuth is a named export. Requires React context provider.
useUpload
✓ import { useUpload } from 'zitejs/upload'
✗ import { useUpload } from 'zitejs'
useUpload is exported from 'zitejs/upload', not root package.
ZitePdf
✓ import { ZitePdf } from 'zitejs/pdf'
✗ import ZitePdf from 'zitejs/pdf'
ZitePdf is a named class export.
ZiteSchedule
✓ import { ZiteSchedule } from 'zitejs/schedules'
✗ import { ZiteSchedule } from 'zitejs/schedule'
The module is 'schedules' (plural). Typo leads to module not found.

Shows usage of database client, API endpoint creation, and auth hook with ZiteJS.

// Setup: run `zite sync` to generate db client import { zite } from 'zitejs/db'; import { createEndpoint } from 'zitejs/api'; import { useAuth } from 'zitejs/auth'; // Example: fetch all users const users = await zite.users.findMany(); // Example: endpoint export default createEndpoint({ execute: async ({ input }) => { const users = await zite.users.findMany({ where: { role: input.role } }); return { data: users }; } }); // Example: auth hook function Profile() { const { user } = useAuth(); return <div>Hello {user?.name}</div>; }
Debug
Known issues
breakingBreaking change in v0.9.0: The database client moved from 'zitejs' to 'zitejs/db'. Old import will break.
fix
Update import to import { zite } from 'zitejs/db'.
affects: <0.9.0
gotchaPeer dependencies @tanstack/react-query >=5 and react >=18 are required for React hooks; missing them causes runtime errors.
fix
Install peer deps: npm install @tanstack/react-query react
affects: >=0.0.0
gotchaThe auth module requires a provider component wrapping your app. Without it, useAuth will throw.
fix
Wrap app with <AuthProvider> from 'zitejs/auth'.
affects: >=0.0.0
deprecatedIn v0.9.0, the old pattern of importing from root 'zitejs' is deprecated and will be removed in next major.
fix
Use subpath imports like 'zitejs/db', 'zitejs/api', etc.
affects: >=0.9.0
Errors
Common errors & fixes
Cannot find module 'zitejs' or its corresponding type declarations.
Importing from root 'zitejs' instead of a subpath like 'zitejs/db'.
fix
Change import to import { zite } from 'zitejs/db'.
Uncaught TypeError: Cannot destructure property 'user' of 'useAuth(...)' as it is undefined.
Missing AuthProvider or using useAuth outside React component tree.
fix
Ensure AuthProvider wraps the component and useAuth is called inside a component.
Cannot find module 'zitejs/schedule' or its corresponding type declarations.
Typo: module is 'schedules' (plural).
fix
Import from 'zitejs/schedules'.
Module '"zitejs/api"' has no exported member 'createEndpoint'. Did you mean to use default import?
Using default import instead of named import for createEndpoint.
fix
Use named import: import { createEndpoint } from 'zitejs/api'.
Upgrade
Version history
0.9.34latest on npm
Audit
Dependencies
@tanstack/react-queryoptionalRequired for data synchronization and query management in React applications.
reactoptionalRequired for hooks like useAuth and useUpload.
Agent activity
38 hits · last 30 days
node
32
OpenAI (training)
1
Resources
packagezitejs ↗
zitejs — npm install zitejs · libregistry