y-sweet icon indicating copy to clipboard operation
y-sweet copied to clipboard

Pass a callback to get clientToken

Open scottrblock opened this issue 6 months ago • 1 comments

Hi there, thanks for the work on this project.

What I'd like to do is pass a function to createYjsProvider to get the clientToken, instead of passing it as a string.

This allows the provider to be initially created and passed to wherever it needs to go without having to wait for an http request for the token until later.

This is similar to how y-partykit works - https://github.com/partykit/partykit/blob/main/packages/y-partykit/src/provider.ts#L568-L580

This looks like a pretty straightforward change, happy to take an initial stab at it, but figured I'd post it here first.

scottrblock avatar Aug 10 '24 15:08 scottrblock