1.0.4 • Published 5 months ago

next-dropbox-chooser v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

next-dropbox-chooser

Simple nextjs wrapper for Dropbox Chooser API

Installation

npm install next-dropbox-chooser

Usage

<DropboxChooser 
    appkey={'your-uniq-app-key'}
    onSuccess={(files) => {window.alert("Here's the file link: " + files[0].link)}}
    cancel={() => {}}
    multiselect={true}
    extensions={['.mp4']} >
    <div className="dropbox-button">Click me!</div>        
</DropboxChooser>

If you are passing app-key as environment variables

In .env file

NEXT_PUBLIC_DROPBOX_APP_KEY = 
PropTypeRequiredDefault ValueDescription
appkeystringYesN/ADropbox app key (required for authentication and authorization).
linkTypestringNopreviewSpecifies whether the links provided by Dropbox are direct links or links leading to a preview of selected files.
extensionsstring[]NoN/AArray of file extensions restricting file selection to those with specified extensions or file types (e.g., "video").
multiselectbooleanNofalseEnables or disables the ability to select multiple files.
onSuccess(files: File[]) => {}YesN/ACallback function executed when files are successfully selected. Receives selected files as a parameter.
onCancel() => voidNoN/AFunction called when the user closes the dialog without selecting a file.
folderselectbooleanNofalseIf true, allows the user to select both folders and files. Cannot use linkType: "direct" with folderselect: true.
sizeLimitnumberNoN/AIf specified, restricts file selection to files with a size less than or equal to the specified limit.
1.0.4

5 months ago

1.0.3

5 months ago

1.0.2

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago