···353536367. setup the correct permissions (see below)
37373838-### or manually install in your own project
3838+### or manually add to your own project
393940401. copy the `src/lib/atproto` folder into your own project
41412. also copy the `src/routes/oauth-client-metadata.json` folder into your project
···7272npm install @atcute/atproto @atcute/bluesky @atcute/identity-resolver @atcute/lexicons @atcute/oauth-browser-client @atcute/client
7373```
74747575-6. (optionally) set your base in `svelte.config.js` (e.g. for github pages: `base: '/your-repo-name/'`) while keeping it as `''` in development.
7575+6. (optionally) set your base in `svelte.config.js` (e.g. for deploying to github pages: `base: '/your-repo-name/'`) while keeping it as `''` in development.
76767777```ts
7878const config = {
···102102103103### change sign up pds
104104105105-If you want to allow sign-up, change the `signUpPDS` variable in `$lib/atproto/settings.ts` to a pds of your choice
105105+If you want to allow sign-up, change the `devPDS` and `prodPDS` variables in `$lib/atproto/settings.ts` to a pds of your choice
106106107107ATTENTION: the current setting (pds.rip) is only for development, all accounts get deleted automatically after a week
108108···115115import { user } from '$lib/atproto';
116116117117// methods:
118118+user.isInitializing;
119119+user.isLoggedIn;
118120user.login(handle);
119121user.signup();
120120-user.isLoggedIn;
121122user.logout();
122123```
123124124124-LoginModal is a component that renders a login modal, add it for a quick login flow (needs tailwind).
125125-(copy the `src/lib/UI` folder into your projects `src/lib` folder, add the `src/app.css` content to your `app.css`)
125125+LoginModal is a component that renders a login modal, add it for a quick login flow (needs tailwind and tailwind/forms, copy the `src/app.css` content to your `app.css`).
126126127127```svelte
128128<script>
129129- import { LoginModal, loginModalState } from '$lib/atproto';
129129+ import { LoginModal, loginModalState } from '$lib/atproto/ui';
130130</script>
131131132132<LoginModal />
···304304 * @param did - The DID of the repository (defaults to current user)
305305 * @returns Repository metadata or undefined on failure
306306 */
307307-export async function describeRepo({ client, did }: { client: Client; did?: Did }) {
307307+export async function describeRepo({ client, did }: { client?: Client; did?: Did }) {
308308 did ??= user.did;
309309 if (!did) {
310310 throw new Error('Error describeRepo: No did');
+11-2
src/lib/atproto/settings.ts
···11+import { dev } from '$app/environment';
22+13export const SITE = 'https://flo-bit.dev';
2435type Permissions = {
···2527 // blobs: ['video/*', 'text/html']
2628 // example: allowing all blob types
2729 // blobs: ['*/*']
2828- blobs: ['hello']
3030+ blobs: []
2931} as const satisfies Permissions;
30323133// Extract base collection name (before any query params)
···35373638// which PDS to use for signup
3739// ATTENTION: pds.rip is only for development, all accounts get deleted automatically after a week
3838-export const signUpPDS = 'https://pds.rip/';
4040+const devPDS = 'https://pds.rip/';
4141+const prodPDS = 'https://selfhosted.social/';
4242+export const signUpPDS = dev ? devPDS : prodPDS;
4343+4444+// where to redirect after oauth login/signup, e.g. /oauth/callback
4545+export const REDIRECT_PATH = '/';
4646+4747+export const DOH_RESOLVER = 'https://mozilla.cloudflare-dns.com/dns-query';
+1-1
src/routes/+layout.svelte
···3344 import { onMount } from 'svelte';
55 import { initClient } from '$lib/atproto';
66- import LoginModal from '$lib/UI/LoginModal.svelte';
66+ import LoginModal from '$lib/atproto/UI/LoginModal.svelte';
7788 let { children } = $props();
99