Build Rich File Upload Experiences with JavaScript
Add powerful file uploading, image editing, and transformation capabilities to your web applications with our comprehensive JavaScript SDK.
Quick Start Example
// Quick start example
import * as filestack from 'filestack-js';
const client = filestack.init('YOUR_API_KEY');
const options = {
onUploadDone: (res) => {
console.log(res.filesUploaded);
},
maxFiles: 5,
accept: 'image/*'
};
client.picker(options).open();
Why Choose Our JavaScript SDK?
Built specifically for modern web development, our JavaScript SDK provides everything you need to handle files in the browser.
Trusted by innovative companies worldwide
Get Started in Minutes
Our JavaScript SDK is designed for developers who want to get file uploading working quickly without sacrificing customization options.
💡Quick CDN option: Want to try it immediately? Skip to CDN example below
- 1Install filestack-js via npm
- 2Import and initialize the client with your API key
- 3Configure your upload options and callbacks
- 4Open the picker and start uploading files
Complete Implementation
// 1. Install filestack-js
npm install filestack-react
// 2. Import and initialize client
import * as filestack from 'filestack-js';
const client = filestack.init('YOUR_API_KEY');
// 3. Configure options
const options = {
maxFiles: 10,
accept: ['image/*', 'video/*'],
fromSources: ['local_file_system', 'url', 'imagesearch'],
onUploadDone: (result) => {
console.log('Upload completed!', result);
// Handle your uploaded files
result.filesUploaded.forEach(file => {
console.log(file.url);
});
}
};
// 4. Open picker
client.picker(options).open();
CDN Alternative
Prefer to get started quickly without a build step? Use our CDN version for rapid prototyping and simple integrations.
- 1Add the script tag to your HTML
- 2Initialize and use filestack globally
CDN Implementation
// Add to your HTML head
<script src="//static.filestackapi.com/filestack-js/4.x.x/filestack.min.js">script>
// Use filestack globally
const client = filestack.init('YOUR_API_KEY');
const options = {
maxFiles: 10,
accept: ['image/*', 'video/*'],
onUploadDone: (result) => {
console.log('Upload completed!', result);
result.filesUploaded.forEach(file => {
console.log(file.url);
});
}
};
client.picker(options).open();
Implement JavaScript File Solutions
Join thousands of developers who trust Filestack to handle their file management needs. Get started with our JavaScript SDK today.