@pureweb/cra-template-pureweb-client

4.10.2 • Public • Published

PureWeb Create React App template

The official PureWeb template for Create React App

Usage

npx create-react-app my-app --template @pureweb/cra-template-pureweb-client

On Mac OS when running npm 8+ you might need to specify create-react-app version 5.0.0

npx create-react-app@5.0.0 my-app --template @pureweb/cra-template-pureweb-client

This will generate a typescript-based react application, ready for you to customize and configure to your needs.

Setting up client.json for use with Hosted Models

  1. Sign in to https://console.pureweb.io.
  2. Create a project

Configuration

In order to develop your client against a given project and model that is already hosted on the PureWeb platform you will need to configure client.json, located in the generated client code under src/client.json.

{
  "projectId": "b1f3a842-42e1-40b5-9f04-480cf87b59c8",
  "modelId": "72e23f8d-c68b-422d-9f81-004922bfc37a"
}

You can optionally specifiy a version of the model to use.

{
  "projectId": "b1f3a842-42e1-40b5-9f04-480cf87b59c8",
  "modelId": "72e23f8d-c68b-422d-9f81-004922bfc37a",
  "version": "abcefg"
}

Alternatively, the projectId, modelId, and optional version can also be specified through query parameters:

http://localhost:3000?projectId=b1f3a842-42e1-40b5-9f04-480cf87b59c8&modelId=72e23f8d-c68b-422d-9f81-004922bfc37a&version=abcefg

Developing with model running locally

To learn more about the local workflow for running the game and the PureWeb streaming agent on your own machine, see the getting started information here: https://www.npmjs.com/package/@pureweb/platform-streaming-agent

Package Sidebar

Install

npm i @pureweb/cra-template-pureweb-client

Weekly Downloads

30

Version

4.10.2

License

MIT

Unpacked Size

142 kB

Total Files

25

Last publish

Collaborators

  • agentjacek
  • kviggers
  • jarabek