Skip to content

Commit

Permalink
Merge pull request #42 from DIMO-Network/development
Browse files Browse the repository at this point in the history
Updated Docs for Development
  • Loading branch information
MoizAhmedd authored Dec 17, 2024
2 parents 02c245e + 28c5f05 commit 0a4ac49
Showing 1 changed file with 35 additions and 7 deletions.
42 changes: 35 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ This repository includes two components:
2. **Example React App**: A React application demonstrating the use of the SDK for user authentication.

### Prerequisites
The example app assumes that the DIMO auth flow (https://github.com/DIMO-Network/dimo-login) is running on http://localhost:3000. Ensure that the auth service is up and running before starting the example app to enable the full login flow.
The example app embeds/frames the DIMO auth flow (login.dimo). To test both sides locally, please make sure (https://github.com/DIMO-Network/dimo-login) is running locally, and set the BaseDimoButton endpoint to point to that port

## Getting Started

The project currently uses a file import setup for the SDK in the example app. To get everything running, follow these steps:

### Step 1: Live Build the SDK
Note: We currently don't have live build/reload support

### Step 1: Build the SDK

First, navigate to the `sdk` directory and start a live build of the SDK using the following command:

Expand All @@ -23,10 +25,31 @@ npm i
and then

```bash
npm run watch
npm run build
```

### Step 2: Pack the SDK

We want to create a .tgz file that our app can use

```bash
npm run pack
```

This will create a .tgz file with the version of the SDK mentioned in package.json

### Step 3: Verifying import

Move the .tgz file from sdk, to example-dimo-auth

In example-dimo-auth, verify that the package.json is importing the correct .tgz file

Example
```bash
"@dimo-network/login-with-dimo": "file:./dimo-network-login-with-dimo-0.0.14.tgz",
```

### Step 2: Run the Example App
### Step 4: Run the Example App
Once the SDK is live-building, navigate to the example-dimo-auth directory and run the React app:

```
Expand All @@ -42,6 +65,11 @@ npm start
This will start the example app on http://localhost:3001.


### Usage
The SDK enables the "Login with DIMO" button for user authentication.
The example app demonstrates how to integrate the SDK into a React project.
## Publishing and Development

We recommend the following steps for pushing updates, and releasing new versions
1. Make changes on a new branch, an update the package version
2. Merge changes into development, and test on https://sample.dev.drivedimo.com
3. Merge changes into main, test on https://sample.drivedimo.com
4. Create a new release, with the new version tag
5. The new version will automatically be deployed to npm

0 comments on commit 0a4ac49

Please sign in to comment.