supertokens/supertokens-flutter

Research Points

Closed this issue · 9 comments

  1. Flutter platform channels vs Pure dart
  2. Dio vs Http
  • Interception
  • Popularity
  • Cookie management
  • Cookie persistence
  1. CICD - Codemagic vs Travis
  1. Dio vs http
  • Both support interception. Dio has a straightforward way in comparison (similar to axios), http requires extending the base network client and extending functionality to intercept requests and append headers (unclear about intercepting responses)

  • http is currently used more because the official documentation links to it, Dio seems more complete with more and more of the community switching

  • Dio supports custom cookie handling and provides packages for cookie jars and persistent cookies. http provides basic cookie management with no customisation options and does not persist cookies (or provide a way to do so)

  1. CICD - Codemagic vs Travis

Both are equally capable for the use case, Codemagic has a solution built specifically for Flutter and seems to be the preferred choice in the community. This can be evaluated during setup, the only clear difference was that Codemagic as a platform seemed slightly more robust and has a better GUI for configuring plans

@nkshah2 thanks. I think you have missed point number 1. Also, based on your understanding, how many days will it take to make the SDK? Thanks

Ah youre right, I didnt realise I missed that

  1. Flutter platform channels vs Pure dart

A Pure dart solution would make more sense at the moment because it will keep the SDK simple enough to implement and integrate. Anyone that does require specific native implementations would have their network stack in platform channels anyway and for them it would make sense to integrate the native versions of supertokens directly.


I think going ahead with an implementation of Dio seems like the better choice, in that case it shouldnt take more than a week's worth of days to finish the SDK, implement test cases and setup an example project (thats roughly 7 working days). It probably wont take that long but I have not worked with Dio very extensively so just adding a buffer to go through the APIs it exposes and provide the most commonly used ones in the initial version of the SDK.

I have asked the following questions to the "client":

  • Which network stack do you use in flutter?
  • which version of the core are you using?

Once they reply, I will update this issue.

@nkshah2 answers:

  • Using Flutter 2.0 and http 0.13.1 to make http requests
  • Using core 2.5. This means you should look at the code in supertokens-website, version 4.4.X (branch 4.4)
  • Using laravel 8.16, supertokens-laravel version 1.5.X

Do these answer your questions?

@rishabhpoddar Yes that does answer my questions, ill have to research a little bit more on interception using the http package to get a better idea of how to go about this.

For context, these are the points im going to research further:

  • Cookie management in http
  • Persistent cookie storage
  • Http request/response interception

Closing since this doesnt need any more discussion