Delete App Services User from backend

Well, it’s July and Apple is requiring the deletion of accounts from in the app.

I have been monitoring this part of the documentation to make sure that I can do this correctly, but it seems like it’s still in manual mode for the time being.

I created a function where I remove their login information from my CustomJWT database (props to Cosync for making JWT information easy to handle.

Next, I need to delete all of the data in that user’s partition, and ultimately delete the user.

I can easily wipe all of the data, but there doesn’t seem to be a way to programmatically delete the user. There does seem to be a way in the Swift SDK, but these apps are React Native.

I thought I could just leave that user there, but it seems like creating a new account with the same email will ultimately grab that old user account, and I don’t want that to happen. For instance, I could delay deleting their data for 72 hours and offer a restore option through support, but if they Delete Account and sign up again with the same email, that data will still be linked to the old App Services User since I’m partitioning on that id.

Is there a way to delete an App Services User from a function yet? If not, is this something that is coming? This seems to be pretty important for anyone building on iOS now since our updates won’t go through App Review without it.

1 Like

Hey @Kurt_Libby1 - the delete user API does exist in React Native, but it looks like we missed adding it to that page. I’ll get that updated.

For the testing apps we use for the docs, we have written a custom deleteAllUsers func that authenticates via the Admin API and deletes users. You could do something similar to delete specific users. The users endpoints include separate endpoints to delete confirmed & pending users. I’ll add something to the docs about using a custom func w/the admin API to delete users, too.

Thanks for pointing this out!


Following up; I’ve updated the Delete Users page to have links to those SDK APIs in RN and Node.js, and have added an example of a custom function you might use to delete users via the App Services Admin API. Hope this helps!

Amazing! Thanks Dachary.