File Storage
Docs menu

Guides

Rich-text editor plugins

Add a File Storage button to your editor toolbar. It opens the file picker and inserts the selected file URL into the document.

How it works

  1. Load the public CDN loader: https://cdn.filestorage.io/loader.min.js.
  2. Load the plugin for your editor after both the loader and the editor script.
  3. Pass the same options you would give mount() — apiKey plus s3 or http (register the page host under Dashboard → Websites).

TinyMCE

Register filestorage as a plugin and toolbar button, and pass options under the filestorage key.

tinymce.html
<script src="https://cdn.filestorage.io/loader.min.js"></script>
<script src="https://cdn.filestorage.io/plugins/tinymce/plugin.js"></script>
<script>
  tinymce.init({
    selector: '#editor',
    plugins: 'filestorage',
    toolbar: 'filestorage',
    filestorage: {
      apiKey: 'fs_live_…',
      s3: { proxyBaseUrl: 'https://your-proxy.example' },
    },
  })
</script>

CKEditor 5

Pass FileStorageCKEditor.plugin() in extraPlugins so the button exists before the toolbar renders, then add 'filestorage' to the toolbar items.

ckeditor.html
<script src="https://cdn.filestorage.io/loader.min.js"></script>
<script src="https://cdn.filestorage.io/plugins/ckeditor5/filestorage.js"></script>
<script>
  ClassicEditor.create(document.querySelector('#editor'), {
    extraPlugins: [
      FileStorageCKEditor.plugin({
        apiKey: 'fs_live_…',
        s3: { proxyBaseUrl: 'https://your-proxy.example' },
      }),
    ],
    toolbar: { items: ['bold', 'italic', '|', 'filestorage'] },
  })
</script>

Froala

Register the command before creating the editor, then add 'filestorage' to toolbarButtons.

froala.html
<script src="https://cdn.filestorage.io/loader.min.js"></script>
<script src="https://cdn.filestorage.io/plugins/froala/filestorage.js"></script>
<script>
  FileStorageFroala.register(FroalaEditor, {
    apiKey: 'fs_live_…',
    s3: { proxyBaseUrl: 'https://your-proxy.example' },
  })

  new FroalaEditor('#editor', {
    toolbarButtons: ['filestorage', '|', 'bold', 'italic'],
  })
</script>

Any other editor: openFilePicker()

Using Quill, Tiptap, Lexical, or a plain <textarea>? Open the picker yourself and handle the selection. Users pick a file by opening its preview and clicking Insert selected file; Escape or the Close button cancels. It returns { close } so you can dismiss it programmatically.

JavaScript
const picker = FileStorageSDK.openFilePicker({
  apiKey: 'fs_live_…',
  s3: { proxyBaseUrl: 'https://your-proxy.example' },
  onSelect(file) {
    // file: { path, name, url?, mimeType? }
    const isImage = file.mimeType?.startsWith('image/')
    editor.insert(
      isImage
        ? `<img src="${file.url}" alt="${file.name}">`
        : `<a href="${file.url}">${file.name}</a>`,
    )
  },
  onCancel() {
    console.log('Picker closed')
  },
})