For react js /angular or any project (which can have web and mobile app) which sdk should be use either js sdk or rest api .
Is there any thing that js sdk will have more features or more powerful in comparison to rest api , on other hand rest api may have some limitations?
So basically in which scenario should user decide which sdk JS or Rest ?
Because rest api can be use directly in mobile apps so there are no need of different sdk . one can consume or post all data using rest api .
dblythy
September 14, 2021, 7:59am
2
I would recommend using the SDKs where you can, as the SDKs are regularly updated when new features are added, and handle data storage, session tokens, etc for you. I would only use the REST APIs for platforms that don’t have SDKs.
If there is anything in the REST API that isn’t in the JS SDK, or you are having troubles with the SDKs, feel free to let us know.
If you are building a mobile app, you can use the Mobile SDKs as well, such as Parse Swift, which wrap up the Rest API for you.
For React app, you can also check out this react lib , which works together with JS SDK and makes queries more convenient via hooks.
cbaker6
September 14, 2021, 10:27pm
4
In addition to the points added by @dblythy nd @davimacedo the SDKs know how to “speak parse” via REST and typically manipulate your data in the appropriate ways before sending to the server, making your life easier. For an example of this, handling authentication/login properly:
opened 04:48AM - 21 Apr 21 UTC
closed 10:55PM - 29 Aug 23 UTC
type:bug
### New Issue Checklist
<!--
Please check the following boxes [x] before s… ubmitting your issue.
Click the "Preview" tab for better readability.
Thanks for contributing to Parse Server!
-->
- [x] I am not disclosing a [vulnerability](https://github.com/parse-community/parse-server/blob/master/SECURITY.md).
- [x] I am not just asking a [question](https://github.com/parse-community/.github/blob/master/SUPPORT.md).
- [x] I have searched through [existing issues](https://github.com/parse-community/parse-server/issues?q=is%3Aissue).
- [x] I can reproduce the issue with the [latest version of Parse Server](https://github.com/parse-community/parse-server/releases).
### Issue Description
Calling user.linkWith() server-side doesn't remove the "anonymous" field from the authData object field, causing Parse.AnonymousUtils to still report the user as an Anonymous user.
### Steps to reproduce
````js
Parse.Cloud.define('linkWithAccount', async (request) => {
const user = request.user;
if (!user) throw 'NoUser';
const provider = request.params.provider as string;
const authData = request.params.authData as any;
if (!provider) throw 'NoProvider';
else if (!authData) throw 'NoAuthData';
await user.linkWith(provider, { authData }, {
useMasterKey: true,
sessionToken: user.getSessionToken()
});
return { ok: true };
});
````
### Actual Outcome
The authData field on Parse Database still has the "anonymous" field, resulting in Parse.AnonymousUtils to still report the user as an Anonymous user
````
{
"anonymous": {
"id": "<random-string>"
},
"<linked_service_name>": {
...linked_service_data
}
}
````
### Expected Outcome
Inpecting the authData field on Parse Database not have the anonymous field (should only have..)
````
{
"<linked_service_name>": {
...linked_service_data
}
}
````
### Failing Test Case / Pull Request
<!--
Check one of the following boxes [x] if you added a PR and add the link.
See the contribution guide for how add a test cases:
https://github.com/parse-community/parse-server/blob/master/CONTRIBUTING.md
-->
- [ ] 🤩 I submitted a PR with a fix and a test case.
- [ ] 🧐 I submitted a PR with a failing test case.
### Environment
Server
- Parse Server version: `4.5.0`
- Operating system: `Mac OS X Mojave 10.14.6`
- Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): `Heroku`
Database
- System (MongoDB or Postgres): `MongoDB`
- Database version: `FILL_THIS_OUT`
- Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): `MongoDB Atlas`
Client
- SDK (iOS, Android, JavaScript, PHP, Unity, etc): `Javascript (React-Native)`
- SDK version: `2.19.0`
### Logs
It’s easy to make mistakes attempting to handle ParseObjects on your own via REST, so it’s recommended to use the SDKs when possible.