The In World Poll App allows admins to create a poll by configuring a question and up to 5 answer options. Users can then vote for their preferred option and view the poll results once they've cast their vote. Results are displayed based on a configuration that shows either the percentage or the total number of votes for each answer.
- Key Asset: When clicked, this asset opens the app in the drawer and allows both admins and users to interact with the poll.
-
User View:
- Main page with a placeholder text if no poll is configured.
- Displays the poll title, question, and available answers.
- Allows users to cast a single vote and view poll results (either as percentages or vote counts based on admin configuration).
-
Admin View:
- Accessible via a settings icon on the main page.
- Contains poll configuration options and admin-specific interactions (see below).
- Access:
- When the admin clicks on the key asset, the app opens in the drawer.
- A settings icon on the main page leads to the admin page.
- Poll Configuration:
- Question Entry: Admin can enter the poll question.
- Answer Options:
- Admin can provide between 2 to 5 answer options.
- Five text fields are provided; only fields with input values are dynamically rendered for users.
- Display Mode:
- Admin selects whether poll results are displayed as a percentage or as a number of votes via radio buttons
- Options:
- Percentage
- Number of Votes
- Save Button:
- Clicking on the Save button updates the app with the current poll filled out in the admin form page and deletes any existing data in the assets data object
- Reset Button:
- Clicking on the Reset button clears the current poll and all the saved data in the assets data object
- Key Asset: the data object attached to the dropped key asset will store information related to this specific implementation of the app and would be deleted if the key asset is removed from world. Example data:
- question: string;
- answers: string[];
- displayMode: "percentage" | "count";
- options?: { [key: string]: { votes: number } };
- results?: { [profileId: string]: { answer: number } };
Create a .env file in the root directory. See .env-example for a template.
| Variable | Description | Required |
|---|---|---|
NODE_ENV |
Node environment | No |
SKIP_PREFLIGHT_CHECK |
Skip CRA preflight check | No |
INSTANCE_DOMAIN |
Topia API domain (api.topia.io for production, api-stage.topia.io for staging) |
Yes |
INTERACTIVE_KEY |
Topia interactive app key | Yes |
INTERACTIVE_SECRET |
Topia interactive app secret | Yes |
- Clone this repository
- Run
npm iin server cd client- Run
npm iin client cd ..back to server
See Environment Variables above.
Topia Production Account Dashboard
- SDK Developer docs
- To see an example of an on canvas turn based game check out TicTacToe: