···1+# Simple ATProto OAuth
2+3+Simple ATProto OAuth example project using Vite and vanilla JS.
4+5+6+# Development
7+- `pnpm install` or even `npm install`
8+- `pnpm run dev`
9+- By default, the OAuth client is the local dev one. Need to make sure you access from [http://127.0.0.1:5173](http://127.0.0.1:5173) for it to work properly.
10+- If you want to change the oauth scopes they are at the top of [./src/main.js](./src/main.js)
11+- Very simple vanilla JS app show casing how to use OAuth with ATProto.
12+- On login sets `window.atpAgent` which is an authenticated ATProto agent to make atproto calls.
13+14+15+# Production/Running with a domain
16+If you are running this in production or with a public ascessible domain need to make a few changes.
17+- Set change the text `{yourdomain.com}` in [./public/oauth-client-metadata.json](./public/oauth-client-metadata.json) in `redirect_uris` and `client_id` to your domain.
18+- If you want to change any of the oauth scopes that's also done in [./public/oauth-client-metadata.json](./public/oauth-client-metadata.json) and loaded into the client.
19+- Make a copy of [.env.template](.env.template) and rename it to `.env` set the domain without https for `VITE_OAUTH_DOMAIN`
20+- If you're using vite to host it to test with something like ngrok/cloudflared you need to set the domain in [vite.config.js](vite.config.js) where it says `yourdomain.com`
21+- Make sure it's accessible from the internet. The PDS needs to call it. Also, if you keep this same design all routes need to go to the `index.html`