Skip to content
This repository has been archived by the owner on May 13, 2023. It is now read-only.

feat: add realtimeClientOptions to SupabaseClient #173

Merged
merged 4 commits into from
Feb 5, 2023

Conversation

dshukertjr
Copy link
Member

@dshukertjr dshukertjr commented Feb 1, 2023

What kind of change does this PR introduce?

Realtime client has a eventsPerSecond parameter, that can be overridden by passing it to the params parameter on the constructore of RealtimeClient.

This PR adds a new realtimeClientOptions parameter of type RealtimeClientOptions to the SupabaseClient constructor and adds eventsPerSecond parameter.

Other context

I'm working on a realtime gaming app using Supabase and Flame, and with because of not being able to override eventsPerSecond, I can only send broadcast events 10 times a second, which makes the game feel not so smooth. Adding this option and bringing the eventsPerSecond up to 30 made it look very smoooth.

@dshukertjr dshukertjr changed the title Feat/realtime params feat: realtimeClientOptions to SupabaseClient Feb 1, 2023
params: {'apikey': supabaseKey},
params: {
'apikey': supabaseKey,
if (eventsPerSecond != null) 'eventsPerSecond': '$eventsPerSecond'
Copy link
Member Author

@dshukertjr dshukertjr Feb 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eventsPerSecond is expected to be a String here for some reason.

@dshukertjr dshukertjr requested review from Vinzent03 and bdlukaa and removed request for bdlukaa and Vinzent03 February 3, 2023 02:08
@dshukertjr dshukertjr merged commit c3def57 into main Feb 5, 2023
@dshukertjr dshukertjr deleted the feat/realtime-params branch February 5, 2023 15:14
@dshukertjr dshukertjr changed the title feat: realtimeClientOptions to SupabaseClient feat: add realtimeClientOptions to SupabaseClient Feb 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants