---
title: Jodit Connector Node.js
description: TypeScript-based file management backend for Jodit editor.
keywords: jodit nodejs, file connector, backend, typescript
---

# Jodit Connector Node.js

[![npm](https://img.shields.io/npm/v/jodit-nodejs.svg)](https://www.npmjs.com/package/jodit-nodejs)
[![Documentation](https://img.shields.io/badge/docs-latest-blue.svg)](https://jodit.github.io/jodit-nodejs/)

TypeScript-based file management backend for the Jodit Editor.

## Features

- File operations (browse, upload, rename, move, delete)
- Folder management
- Image processing
- Document generation
- Authentication & access control
- Express integration
- Custom storage adapters
- Auto-generated OpenAPI documentation
- Role-based access control

## Installation

### NPM

```bash
npm install jodit-nodejs
```

### Docker

Pull the Docker image:

```bash
docker pull xdsoft/jodit-nodejs:latest
```

Run the container:

```bash
docker run --rm -p 8081:8081 xdsoft/jodit-nodejs
```

The server will be available at `http://localhost:8081`.

## Basic Usage

### Start Server with Default Configuration

```typescript
import { start } from 'jodit-nodejs';

// Start server with default config
const server = await start(8081);
console.log('Server running on http://localhost:8081');
```

### Authentication Example

```typescript
import { start, AuthCallback } from 'jodit-nodejs';

const checkAuth: AuthCallback = async req => {
	const token = req.headers.authorization;
	if (!token) return 'guest';

	// Validate token and return user role
	const user = await validateToken(token);
	return user.role;
};

const server = await start(8081, {
	auth: checkAuth
});
```

### Custom Configuration

```typescript
import { start } from 'jodit-nodejs';

const server = await start(8081, {
	baseDir: './uploads',
	auth: async req => {
		// Your authentication logic
		return 'admin';
	},
	accessControl: {
		admin: {
			read: true,
			write: true,
			delete: true
		},
		guest: {
			read: true,
			write: false,
			delete: false
		}
	}
});
```

## Integration with Jodit Editor

Configure Jodit Editor to use your jodit-nodejs backend:

```javascript
Jodit.make('#editor', {
	uploader: {
		url: 'http://localhost:8081/upload'
	},
	filebrowser: {
		ajax: {
			url: 'http://localhost:8081'
		}
	}
});
```

### With Authentication

```javascript
Jodit.make('#editor', {
	uploader: {
		url: 'http://localhost:8081/upload',
		headers: {
			Authorization: 'Bearer YOUR_TOKEN'
		}
	},
	filebrowser: {
		ajax: {
			url: 'http://localhost:8081',
			headers: {
				Authorization: 'Bearer YOUR_TOKEN'
			}
		}
	}
});
```

## Key Technologies

- **TypeScript** with strict mode
- **Express 5.x** framework
- **Zod** runtime validation
- **Winston** logging
- **@hapi/boom** error handling

## Documentation

For more details, visit the [official documentation](https://jodit.github.io/jodit-nodejs/).

## License

MIT
