···11+# Simple ATProto OAuth
22+33+Simple ATProto OAuth example project using Vite and vanilla JS.
44+55+66+# Development
77+- `pnpm install` or even `npm install`
88+- `pnpm run dev`
99+- 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.
1010+- If you want to change the oauth scopes they are at the top of [./src/main.js](./src/main.js)
1111+- Very simple vanilla JS app show casing how to use OAuth with ATProto.
1212+- On login sets `window.atpAgent` which is an authenticated ATProto agent to make atproto calls.
1313+1414+1515+# Production/Running with a domain
1616+If you are running this in production or with a public ascessible domain need to make a few changes.
1717+- 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.
1818+- 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.
1919+- Make a copy of [.env.template](.env.template) and rename it to `.env` set the domain without https for `VITE_OAUTH_DOMAIN`
2020+- 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`
2121+- 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`