Skip to main content

Getting Started

Pixstore is published on npm and can be installed easily:

npm install pixstore

Pixstore is modular and cannot be imported as a single package:

import Pixstore from 'pixstore' // ❌ This will NOT work

Instead, import from one of the following entrypoints based on your needs:

pixstore/backend

For backend (Node.js) usage: image storage, database, HTTP server, etc.

import { initPixstoreBackend } from 'pixstore/backend'

For a full list of available exports API Reference/Backend Module.

pixstore/frontend

For browser (frontend) usage: image cache, fetching, and storage in IndexedDB.

import { initPixstoreFrontend } from 'pixstore/frontend'

For a full list of available exports API Reference/Frontend Module.

pixstore/shared

For code shared between backend and frontend, such as error handling and utilities.

import { setCustomErrorHandler } from 'pixstore/shared'

For a full list of available exports API Reference/Shared Module.

pixstore/types

For TypeScript types and interfaces. Use anywhere for type safety.

import type { ImageRecord } from 'pixstore/types'

For a full list of available exports API Reference/Types.