|
1 | | -# Getting Started with Vite |
| 1 | +# React Ditto Example with Vite and TypeScript |
2 | 2 |
|
3 | | -This project was bootstrapped with [Vite](https://vite.dev/). |
| 3 | +This example demonstrates how to use Ditto with React, TypeScript, and Vite. |
| 4 | + |
| 5 | +## Ditto Authentication Setup |
| 6 | + |
| 7 | +For detailed information about Ditto authentication, refer to the [Ditto Authentication Documentation](https://docs.ditto.live/key-concepts/authentication-and-authorization). |
| 8 | + |
| 9 | +### Configuring the Application |
| 10 | + |
| 11 | +To use Online mode with Ditto Cloud authentication, you need to configure the following constants in `src/AppContainer.tsx`: |
| 12 | + |
| 13 | +1. **DITTO_APP_ID**: Your Ditto application ID |
| 14 | +2. **DITTO_AUTH_URL**: The authentication endpoint URL |
| 15 | +3. **DITTO_WEBSOCKET_URL**: The WebSocket endpoint URL |
| 16 | + |
| 17 | +All these values can be found in your Ditto portal on your app's settings page. |
| 18 | + |
| 19 | +### Using Online Mode |
| 20 | + |
| 21 | +When you select "Online" from the identity dropdown in the application: |
| 22 | + |
| 23 | +1. An authentication panel will appear at the bottom of the screen |
| 24 | +2. Enter the following credentials: |
| 25 | + - **Provider**: The authentication provider name configured in your Ditto app (e.g., "development", "jwt", etc.) |
| 26 | + - **Token**: The authentication token or credentials for your chosen provider |
4 | 27 |
|
5 | 28 | ## Available Scripts |
6 | 29 |
|
@@ -35,6 +58,8 @@ Runs `eslint` to find and fix any configured linting issues |
35 | 58 |
|
36 | 59 | ## Learn More |
37 | 60 |
|
| 61 | +To learn about Ditto, check out the [Ditto documentation](https://docs.ditto.live/). |
| 62 | + |
38 | 63 | You can learn more in the [Vite documentation](https://vite.dev/guide/). |
39 | 64 |
|
40 | 65 | To learn React, check out the [React documentation](https://react.dev/). |
0 commit comments