---
title: "Tiny Drive plugin setup options"
description: "List of Tiny Drive plugin configuration options for integrating with TinyMCE."
canonical_url: "https://www.tiny.cloud/docs/tinymce/latest/tinydrive-setup-options/"
md_url: "https://www.tiny.cloud/docs/tinymce/6/tinydrive-setup-options/index.md"
version: "6"
last_updated: "2022-11-30T01:26:11Z"
tokens: 624
---
Important This page documents TinyMCE 6. For new projects, Tiny recommends using the latest, most up-to-date version. [See TinyMCE 8 documentation](../../latest/tinydrive-setup-options/).
# Tiny Drive plugin setup options

## `tinydrive_token_provider`

This option could take one of the following two forms:

- A URL to a page or endpoint that accepts a HTTP JSON POST request, and produces a JSON structure with a valid JWT.
- A function that provides the same token through a callback, allowing a HTTP request in any desired format. The token provider function should have a success and a failure callback, where:

  - The success callback accepts an object with a `token` property containing the JWT
  - The failure callback accepts a string to present as an error message if the token could not be produced.

For information on how to create these tokens, refer to the [JWT authentication guide](../tinydrive-jwt-authentication/).

**Type:** `String` or `Function`

**Required:** yes

### Example Using a JWT Provider URL

```js
tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  plugins: 'tinydrive',
  tinydrive_token_provider: '/jwt' // this can be a page or endpoint like this
});
```

### Example Using a JWT Provider Callback

```js
tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  plugins: 'tinydrive',
  tinydrive_token_provider: (success, failure) => {
     success({ token: 'jwt-token' });
     // failure('Could not create a jwt token')
  }
});
```

## `tinydrive_upload_path`

This option sets the default upload path for files:

- Pasted into the editor,
- Uploaded to the editor through the Image dialog, or
- Dragged and dropped into the editor.

It will produce a date-based structure within this path, such as: `/uploads/{year}{month}{day}`. This is to avoid having thousands of files in the same directory.

**Type:** `String`

**Default value:** `"/uploads"`

### Example: using `tinydrive_upload_path`

```js
tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  plugins: 'tinydrive',
  tinydrive_upload_path: '/some/other/path'
});
```

## `tinydrive_max_image_dimension`

This option constrains the width and height of uploaded images. When specified, any images with a greater width or height than the specified amount would be proportionally resized down to the specified maximum dimension.

**Type:** `Number`

### Example: using `tinydrive_max_image_dimension`

```js
tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  plugins: 'tinydrive',
  tinydrive_max_image_dimension: 1024
});
```
