Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/daniel-le97/logto-react-socket
Logto + react + socket sample
https://github.com/daniel-le97/logto-react-socket
Last synced: about 1 month ago
JSON representation
Logto + react + socket sample
- Host: GitHub
- URL: https://github.com/daniel-le97/logto-react-socket
- Owner: daniel-le97
- License: other
- Created: 2024-07-26T03:41:27.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-07-28T16:29:42.000Z (6 months ago)
- Last Synced: 2024-12-09T14:57:52.669Z (about 2 months ago)
- Language: TypeScript
- Homepage:
- Size: 248 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# React + TypeScript + Vite + Socket + Logto
this app shows an example of hooking up a socket - react app to logto
( i use logto because its very easy to self host on my own server )in particular this shows how to do it using a custom URI scheme and not universal links
## prerequisites
- clone this repo- you'll need to register an account on logto or have your own self hosted instance
- create a native app in logto admin console
- redirect URI: com.auth-react://callback
- sign-out URI: com.auth-react://sign-out
- cors allowed origins: socket://com.auth-react
- replace the values in .env.example with your relevant values, and then rename it to .env
- learn more at [logto](https://logto.io)
- have [socket](https://github.com/socketsupply/socket) built and linked on your system on the "ws" branch```bash
git clone https://github.com/socketsupply/socket.git && cd socket && git switch ws && git pull && pnpm relink
```
if you are using bun you will need to do the following after the above ( if you are not on macos you will need to change the below )```bash
cd ./build/npm/darwin/packages/@socketsupply/socket && bun link
```## getting started
1. install deps
```bash
bun i
```
2. run the app
```bash
ssc build -r
```## for more info check [deep linking](./deep-links.md)
## Acknowledgements
This project uses code from the [logto-io/js] repo, which is licensed under the MIT License.
You can find the original project at [https://github.com/logto-io/js].
( specifically https://github.com/logto-io/js/tree/master/packages/react-sample)