This module for Open Web Desktop enables AT Protocol integration, including OAuth session management, account state, and desktop owner profile fetching.
It wraps nuxt-atproto and exposes the
AT Protocol composables throughout the desktop runtime.
- OAuth session management via
nuxt-atproto - Generates
client-metadata.jsonin/publicfor OAuth - Fetches the desktop owner's ATProto profile at build time
- Provides
useAtprotoAccountStorefor reactive account state - Handles OAuth login / logout from the Account app
@owdproject/core≥ 3.4.0nuxt-atproto≥ 0.1.0 (installed automatically as a dependency)
pnpm desktop add module-atprotoThe AT Protocol OAuth client is configured via the atproto key in your Nuxt
config. This is separate from the desktop config and is required for OAuth to work:
// nuxt.config.ts
export default defineNuxtConfig({
atproto: {
serviceEndpoint: {
private: 'https://bsky.social',
public: 'https://public.api.bsky.app',
},
oauth: {
// Set `writeClientMetadata: true` to generate /public/client-metadata.json
writeClientMetadata: true,
clientMetadata: {
// Leave `remote` empty to use the generated local client-metadata.json.
// Set it to a URL if you host the metadata file yourself.
remote: '',
local: {
client_id: 'https://your-desktop.example.com/client-metadata.json',
client_name: 'My Desktop',
client_uri: 'https://your-desktop.example.com',
logo_uri: 'https://your-desktop.example.com/favicon.ico',
tos_uri: 'https://your-desktop.example.com',
policy_uri: 'https://your-desktop.example.com',
redirect_uris: ['https://your-desktop.example.com'],
scope: 'atproto transition:generic',
grant_types: ['authorization_code', 'refresh_token'],
response_types: ['code'],
token_endpoint_auth_method: 'none',
application_type: 'web',
dpop_bound_access_tokens: true,
},
},
signInOptions: {
state: '',
prompt: 'login',
scope: 'atproto',
ui_locales: 'en',
},
},
debug: false,
},
})// desktop/desktop.config.ts
export default defineDesktopConfig({
// ...
atprotoDesktop: {
owner: {
did: 'did:plc:your-did-here',
},
name: {
title: 'my',
affix: 'Desktop',
},
},
})The owner.profile field is populated automatically at build time by fetching
the profile from the ATProto public API.
The following composables are auto-imported from nuxt-atproto:
| Composable | Description |
|---|---|
useAtprotoSession() |
Reactive OAuth session (session, isLogged, status) |
useAtprotoAuth() |
signIn(), signInWithHandle(), signOut(), restore() |
useAtprotoAgent(scope) |
Cached AT Protocol agent ('authenticated', 'public', or a PDS URL) |
Legacy API (
useAtproto(),useAgent()) still works but is deprecated innuxt-atproto≥ 0.1.0. Prefer the composables above.
| Store | Pinia id | Description |
|---|---|---|
useAtprotoAccountStore |
desktop/atproto/account |
Account profile, session state, handle resolver |
The store persists handleResolver via module-persistence (if installed).
This module is released under the MIT License.