Can you pass Convex Auth info through react-native-webview?
My react-native app uses a rich-text editor which requires a webview. I've been trying to follow https://stack.convex.dev/add-a-collaborative-document-editor-to-your-app to have convex power the collaboration side of things.
My authentication happens using Convex Auth in the main app, but I still need a functional convex in the webview. Does anyone know if there's a way to share the state, or at least share the auth info?
As an alternative, how would you call the prosemirror sync functions manually after getting editor changes through the webview?
Add a collaborative document editor to your app
Or how I learned to love BlockNote, Tiptap and ProseMirror OT sync.
1 Reply
It turned out to be simpler than I thought. From the parent get the JWT like this.
const token = useAuthToken()
. Then pass it to the WebView.
In the webview call convex.setAuth
to return that token.