Use sdk only in backend
See original GitHub issueHow to generate a new Dropbox instance to call upload method? without login ?
clientId is my api key, and clientSecret my api secret I try something like that : but throws accestoken error
let dbx = new Dropbox({ clientId: "xxx", clientSecret: "xxxx" });
await dbx.filesUpload({
path,
contents: fs.readFileSync("documents/temp.pdf")
}).catch((err) => {
throw err;
});
Thanks
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
SDK vs. API: What's the Difference? - IBM
SDK use cases SDKs are part and parcel of mobile app development. They have many use cases: Programming language-specific SDKs like the JSON ......
Read more >Why an SDK is Critical to your API Offering - BlogGeek.me
Offer your SDK as a closed binary, but also give access to the backend API. Those who wish to use the SDK to...
Read more >Using the Web3 SDK: Frontend or Backend? - thirdweb blog
This guide shows how to use our SDK effectively and where your code should live depending on your use case.
Read more >What's the Difference Between an SDK and an API? - Square
SDKs enable developers to create applications and act as the building blocks for your software solution.
Read more >Making SDK calls from a backend service - Amazon Chime SDK
Nearly all Amazon Chime SDK messaging APIs take chime-bearer as a parameter, except APIs meant to be called only by developers, such as...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can’t upload using only an app key and secret. (The app key and secret only identify the app itself; they do not enable access to an account.) You’ll need an access token, and optionally a refresh token for long-term unattended operation, to upload to an account
It is not possible to fully automate the OAuth process where the user chooses to authorize the app and the app then receives the resulting access token and optional refresh token. This needs to be done manually by the user at least once. If your app needs to maintain long-term access without the user manually re-authorizing it repeatedly, the app should request “offline” access so that it gets a refresh token. The refresh token doesn’t expire and can be stored and used repeatedly to get new short-lived access tokens whenever needed, without the user manually reauthorizing the app.
You can find an example here.
@maheshkasindi There are non-Node JavaScript examples, such as this example for uploading, and this example for the authorization flow. The JavaScript examples may not do exactly the same things as the Node examples, but most of the actual code is interchangeable. For example, you can still request “offline” access the same way as the Node example, that is, by using the
getAuthenticationUrl
options accordingly. If something doesn’t seem to be working as expected, please feel free to open a new issue with the details of the issue.