From 28c5f05acbf37cb11a3c2d4100a783a744595f97 Mon Sep 17 00:00:00 2001 From: moizahmedd Date: Tue, 17 Dec 2024 15:37:10 -0500 Subject: [PATCH] updated readme --- README.md | 42 +++++++++++++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index c626b16..520bba9 100644 --- a/README.md +++ b/README.md @@ -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: @@ -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: ``` @@ -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