This repository includes two components:
- SDK: A custom SDK for the "Login with DIMO" button.
- Example React App: A React application demonstrating the use of the SDK for user authentication.
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
The project currently uses a file import setup for the SDK in the example app. To get everything running, follow these steps:
Note: We currently don't have live build/reload support
First, navigate to the sdk
directory and start a live build of the SDK using the following command:
npm i
and then
npm run build
We want to create a .tgz file that our app can use
npm run pack
This will create a .tgz file with the version of the SDK mentioned in package.json
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
"@dimo-network/login-with-dimo": "file:./dimo-network-login-with-dimo-0.0.14.tgz",
Once the SDK is live-building, navigate to the example-dimo-auth directory and run the React app:
npm i
and then
npm start
This will start the example app on http://localhost:3001.
We recommend the following steps for pushing updates, and releasing new versions
- Make changes on a new branch, an update the package version
- Merge changes into development, and test on https://sample.dev.drivedimo.com
- Merge changes into main, test on https://sample.drivedimo.com
- Create a new release, with the new version tag
- The new version will automatically be deployed to npm