Skip to content

Commit f1daedb

Browse files
committed
docs: update README to include Ditto authentication setup and usage instructions
1 parent 8f96228 commit f1daedb

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

examples/vite-typescript-example/README.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,29 @@
1-
# Getting Started with Vite
1+
# React Ditto Example with Vite and TypeScript
22

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
427

528
## Available Scripts
629

@@ -35,6 +58,8 @@ Runs `eslint` to find and fix any configured linting issues
3558

3659
## Learn More
3760

61+
To learn about Ditto, check out the [Ditto documentation](https://docs.ditto.live/).
62+
3863
You can learn more in the [Vite documentation](https://vite.dev/guide/).
3964

4065
To learn React, check out the [React documentation](https://react.dev/).

0 commit comments

Comments
 (0)