@scrimmage/js-sdk
TypeScript icon, indicating that this package has built-in type declarations

1.3.3 • Public • Published

Notes about Next.js integration

To integrate the Scrimmage SDK with a Next.js project, you can use the following code snippet:

useEffect(() => {
    require("@scrimmage/js-sdk").init({
        apiServerEndpoint: 'https://<partner>.apps.scrimmage.co/',
        refreshToken: async () => {
            return '';
        },
        onReady: async () => {
            const player = await require("@scrimmage/js-sdk").instance.api.player.get();
            console.log(player);
        }
    });
});

Inside of the onReady function, you can call any of the SDK methods. For example, to get the player's information, you can call the player.get() method.

Readme

Keywords

none

Package Sidebar

Install

npm i @scrimmage/js-sdk

Weekly Downloads

9

Version

1.3.3

License

ISC

Unpacked Size

63.2 kB

Total Files

72

Last publish

Collaborators

  • vpolishchuk
  • s.konovalenko
  • yevgenius