Skip to content

Commit

Permalink
fix(web): updating readme for UMD usage
Browse files Browse the repository at this point in the history
  • Loading branch information
rallieon committed Dec 1, 2021
1 parent a5bde30 commit 1ad823f
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,26 @@ All payouts are handled internal to the Haste ecosystem and do not require any a
### Web
The Haste team prefers to install libraries via npm install like `npm install @hastearcade/web`.
However, if you prefer to utilize a single script tag you can include the following tag in your HTML:
`<script src="https://unpkg.com/@hastearcade/web/dist/umd/index.js" />`
_SPECIAL NOTE_
If you utilize the script tag above you must preface all your code with `haste.` For example instead of
```typescript
const hasteClient = await HasteClient.build(process.env.HASTE_GAME_CLIENT_ID);
```
you would need to use
```typescript
const hasteClient = await haste.HasteClient.build(process.env.HASTE_GAME_CLIENT_ID);
```
While the primary work of integrating with Haste is performed in the server (where all game logic and score state should be maintained), Haste does provide a web based sdk to assist in the authentication process. In order for a player to play your game, they will need to authenticate with the Haste Arcade.
The web SDK works by utilizing a SSO system with Haste Arcade. The SDK is a wrapper to help facilitate this process.
Expand Down
20 changes: 20 additions & 0 deletions packages/web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,26 @@ The `@hastearcade/web` SDK empowers developers to incoroporate the Haste authent

See [here](https://github.com/playhaste/haste-sdk/blob/main/README.md) for an overview of the haste-sdk repository.

The Haste team prefers to install libraries via npm install like `npm install @hastearcade/web`.

However, if you prefer to utilize a single script tag you can include the following tag in your HTML:

`<script src="https://unpkg.com/@hastearcade/web/dist/umd/index.js" />`

_SPECIAL NOTE_

If you utilize the script tag above you must preface all your code with `haste.` For example instead of

```typescript
const hasteClient = await HasteClient.build(process.env.HASTE_GAME_CLIENT_ID);
```

you would need to use

```typescript
const hasteClient = await haste.HasteClient.build(process.env.HASTE_GAME_CLIENT_ID);
```

## Table of Contents

- [Quickstart](#quickstart)
Expand Down

0 comments on commit 1ad823f

Please sign in to comment.