question

Tim avatar image
Tim asked

Is the Javascript API Compatible with React Native?

Hi everyone,

I've been trying to get the Javascript API to work with my React Native project. I saw the following post and have been playing around for a couple of days with no success.

https://community.playfab.com/questions/17622/do-you-have-a-sdkwrapper-for-react-native.html

The issue I'm having is described in the following Stack Overflow post.

https://stackoverflow.com/questions/59700857/javascript-library-with-typings-is-not-a-module-react-native

Has anyone managed to successfully get the Javascript API to work with React Native? Might anyone with more knowledge have insight on how to approach this? Thanks.

Tim

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Em Lazer-Walker avatar image
Em Lazer-Walker answered

I can't speak to React Native specifically, but I've never been able to get the `playfab-web-sdk` npm module to play well with TypeScript. I usually switch to the `playfab-sdk` module instead; it's supposed to be for server-side node use, but it works great with TypeScript and a modern browser JS pipeline. I'd imagine the same would hold true for RN.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Em Lazer-Walker avatar image Em Lazer-Walker commented ·

Sorry, didn't mean to focus that on TypeScript — saw the SO link you posted and drew a line that might not be correct.

Either way, my underlying problem was that the playfab-web-sdk npm library isn't properly set up correctly to work as an ES6 module, whereas playfab-sdk is. In my case, switching from one to the other cleared up my issues (although be careful, their APIs are slightly different)

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.