Solved

How to force an alias between two user IDs?

  • 26 August 2021
  • 4 replies
  • 340 views

Userlevel 1
Badge +5

 

I’m looking at this chart, but why is there no option to forced an alias create in the Non-Anonymous App User ID. We’re migrating all our user IDs to a new system (new login, new backend), so we will have to force a restore purchase for all of them for them otherwise their subscription isn’t recognized. 

 

The problem is we have a few thousand stripe users, so a restore purchase doesn’t work for them. This will create a support nightmare for us when suddenly thousands of users can’t access their subscription. Why can’t I force create an alias for them to their new user IDs? 

 

Also - under what scenario does the user go from Non-Anonymous to Anonymous without calling logOut() ? Because in our upgrade flow: old app version passed userID to the SDK on int, in new version of app, we will still pass that old userID and then call logIn() once they have signed up with new backend.

 

Can I still manually call the `createAlias` method even though it is deprecated? 

icon

Best answer by ryan 27 August 2021, 19:38

View original

4 replies

Userlevel 5
Badge +9

Hey @Zachary Shakked!

 

There is a REST API for this you can call with a secret key from your server, or you can manually call the `createAlias` method from the SDK. The SDK method is fine to use but will be deprecating it in favor of the server-side REST API.

Sounds like you may be able to run some server-script for this migration?

 

Also - under what scenario does the user go from Non-Anonymous to Anonymous without calling logOut() ?

This should only happen on logOut(), or if the customer uninstalls and re-installs the app.

 

Because in our upgrade flow: old app version passed userID to the SDK on int, in new version of app, we will still pass that old userID and then call logIn() once they have signed up with new backend.

If you can alias these identities on your new backend that could be the cleanest, I’ll shoot you over some more details.

Badge

Where is this createAlias API call documented ? Can’t find it under REST API v1 docs :/

I’ve taken a look over the old v1 API, and over the new v2 API, and I can’t seem to find anything regarding the ‘create alias’ functionality. @ryan or someone else, if it exists, can you please point out where is this specific action located? 

Userlevel 5
Badge +9

Hey all,

The alias endpoint is private since we’ve seen that it’s very error prone and any mistakes done with the alias endpoint are quite destructive (for example, a simple bug where you don’t properly loop through a list of user IDs to alias can be catastrophic and permanent, similar to bulk deleting many users.) And oftentimes there are other, better ways to do things without the alias endpoint. But, if you feel you have a legitimate need for it. open a support ticket and we’ll help you out.

Reply