0.0.3 • Published 1 year ago

@codingfingers/next-dropbox v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

NextJS + Dropbox API tools

Tools for using some of Dropbox API in your NextJS app. List files from any folder on your static page and benefit from automatic revalidation based on Dropbox webhooks.

Environment variables

Variable nameDescription
DROPBOX_APP_KEYYour app's key
DROPBOX_APP_SECRETYour app's secret
DROPBOX_REFRESH_TOKENNever-expiring refresh token

Creating a Dropbox app

TODO: Write docs for app creation

Obtaining refresh token

  1. Replace the variable in the link below with your app's key and visit the URL in a browser:
https://www.dropbox.com/oauth2/authorize?client_id=<DROPBOX_APP_KEY>&token_access_type=offline&response_type=code
  1. Authorize the app access and copy the <ACCESS_CODE>
  2. Replace variables in the curl request below:
curl --location --request POST 'https://api.dropboxapi.com/oauth2/token' \
-u '<DROPBOX_APP_KEY>:<DROPBOX_APP_SECRET>' \
-H 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'code=<ACCESS_CODE>' \
--data-urlencode 'grant_type=authorization_code'
  1. Execute the command and copy the refresh_token
0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago